2020-10-17 14:45:42 +02:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
|
|
|
|
|
|
|
void main() {
|
2021-03-11 14:20:10 +01:00
|
|
|
YoutubeExplode? yt;
|
2020-10-27 14:44:11 +01:00
|
|
|
setUpAll(() {
|
2020-10-17 22:09:52 +02:00
|
|
|
yt = YoutubeExplode();
|
|
|
|
});
|
2020-10-17 14:45:42 +02:00
|
|
|
|
2020-10-27 14:44:11 +01:00
|
|
|
tearDownAll(() {
|
2021-03-11 14:20:10 +01:00
|
|
|
yt?.close();
|
2020-10-17 22:09:52 +02:00
|
|
|
});
|
2020-10-17 14:45:42 +02:00
|
|
|
|
2020-10-17 22:09:52 +02:00
|
|
|
test('Get a channel about page', () async {
|
2022-04-30 17:49:34 +02:00
|
|
|
var channelUrl = 'http://127.0.0.1:8080/www.youtube.com:443/user/FavijTV';
|
2021-03-11 14:20:10 +01:00
|
|
|
var channel = await yt!.channels.getAboutPageByUsername(channelUrl);
|
2020-10-17 22:09:52 +02:00
|
|
|
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
|
|
|
});
|
|
|
|
}
|