File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:dotenv/dotenv.dart' ;
2
2
import 'package:shouldly/shouldly.dart' ;
3
3
import 'package:test/test.dart' ;
4
- import 'package:vkdart/vkdart.dart' ;
5
4
import 'package:vkdart/vkontakte.dart' ;
6
5
7
6
void main () {
8
7
final env = DotEnv (includePlatformEnvironment: true )..load ();
9
- final vkdart = VkDart (env['TOKEN' ]! , groupId: int .parse (env['GROUP_ID' ]! ));
8
+ final vkontakte = Vkontakte (
9
+ token: env['TOKEN' ]! ,
10
+ language: LangApi .ru,
11
+ version: '5.131' ,
12
+ );
10
13
11
14
group ('Testing methods VK' , () {
12
15
group ('check `request` function' , () {
13
16
test ('should produce a positive result' , () async {
14
- final users = await vkdart.request ('users.get' , {'user_id' : 'durov' });
17
+ final users =
18
+ await vkontakte.request ('users.get' , {'user_id' : 'durov' });
15
19
16
20
users.should.beOfType <List <dynamic >>();
17
21
});
18
22
19
23
test ('should display an error' , () async {
20
24
await Should .throwAsync <ApiException >(
21
- () => vkdart .request ('users.report' , {}));
25
+ () => vkontakte .request ('users.report' , {}));
22
26
});
23
27
});
24
28
});
You can’t perform that action at this time.
0 commit comments