Unofficial Dart implementation of Deutsche Bahn’s construction site API
https://pub.dev/packages/db_construction_site
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
623 B
22 lines
623 B
import 'package:test/test.dart';
|
|
|
|
import 'package:db_construction_site/db_construction_site.dart';
|
|
|
|
void main() {
|
|
test('check if example request succeeds', () async {
|
|
final connections =
|
|
await DBConstructionSite().connections.findConnections(Region.hesse);
|
|
expect(connections.length, greaterThan(0));
|
|
});
|
|
|
|
test('check if invalid request fails', () async {
|
|
try {
|
|
await DBConstructionSite(baseUrl: 'https://noanurl.local')
|
|
.connections
|
|
.findConnections(Region.hesse);
|
|
fail("Request succeeds although it should fail");
|
|
} catch (e) {
|
|
// success
|
|
}
|
|
});
|
|
}
|
|
|