youtube_explode/test/channel_about_test.dart

26 lines
752 B
Dart

import 'package:test/test.dart';
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
void main() {
YoutubeExplode? yt;
setUpAll(() {
yt = YoutubeExplode();
});
tearDownAll(() {
yt?.close();
});
test('Get a channel about page', () async {
var channelUrl = 'http://127.0.0.1:8080/www.youtube.com:443/user/FavijTV';
var channel = await yt!.channels.getAboutPageByUsername(channelUrl);
expect(channel.country, 'Italy');
expect(channel.thumbnails, isNotEmpty);
expect(channel.channelLinks, isNotEmpty);
expect(channel.description, isNotEmpty);
expect(channel.joinDate, isNotEmpty);
expect(channel.title, 'FavijTV');
expect(channel.viewCount, greaterThanOrEqualTo(3631224938));
});
}