youtube_explode/test/channel_about_test.dart

26 lines
725 B
Dart
Raw Normal View History

2020-10-17 14:45:42 +02:00
import 'package:test/test.dart';
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
void main() {
2020-10-17 22:09:52 +02:00
YoutubeExplode yt;
setUp(() {
yt = YoutubeExplode();
});
2020-10-17 14:45:42 +02:00
2020-10-17 22:09:52 +02:00
tearDown(() {
yt.close();
});
2020-10-17 14:45:42 +02:00
2020-10-17 22:09:52 +02:00
test('Get a channel about page', () async {
var channelUrl = 'https://www.youtube.com/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));
2020-10-17 14:45:42 +02:00
});
}