cpd_2022_energy/test/EnergyBilanceModelTest.dart

21 lines
897 B
Dart
Raw Normal View History

2022-11-07 22:12:21 +01:00
import 'dart:async';
import 'package:energy_bilance/models/EnergyBilanceModel.dart';
void main() async {
//Location _locationModel;StreamController<Location> _controller;setUp(() {
_controller = StreamController<EnergyBilanceModel>();
_energyModel = EnergyBilanceModel();
});group('[Location Model]', () {
//test('[Model] Check individual values', () async {
_locationModel = Location(
city: 'London',
countryName: 'England',
country: 'England',
currency: 'GBP',
ip: '',
inEu: true,
languages: 'EN',
);// BEGIN TESTS....
expect(_locationModel.city, 'London');expect(_locationModel.countryName.runtimeType, equals(String));expect(_locationModel.country, isNotNull);expect(_locationModel.ip, isEmpty);expect(_locationModel.inEu, isTrue);expect(_locationModel.languages, contains('EN'));expect(_locationModel.currency, startsWith('G'));expect(_locationModel.country, matches('England'));
});}