This repository has been archived on 2023-10-14. You can view files and clone it, but cannot push or open issues or pull requests.
canteenlib/test/canteenlib_test.dart

32 lines
879 B
Dart
Raw Normal View History

import 'package:canteenlib/canteenlib.dart';
import 'package:test/test.dart';
import 'package:dotenv/dotenv.dart';
void main() {
group('A group of tests', () {
var env = DotEnv(includePlatformEnvironment: true)..load();
Canteen c = Canteen(env["ADDRESS"]!);
2022-09-04 11:38:22 +02:00
test('Log-in test', () {
c.login(env["USER"]!, env["PASS"]!).then((r) => expect(r, true));
});
test('First Test', () {
2022-09-04 11:38:22 +02:00
c.login(env["USER"]!, env["PASS"]!).then((r) {
c.jidelnicekDen().then((t) {
expect(DateTime.now().day, t.den.day);
});
});
});
test('Neprázdný jídelníček', () {
c.login(env["USER"]!, env["PASS"]!).then((r) {
c.jidelnicekDen(den: DateTime.now().add(Duration(days: 5))).then((t) {
2022-09-04 11:38:22 +02:00
print(t.jidla[0].nazev);
expect(t.jidla[0].nazev.isNotEmpty, true);
});
});
});
});
}