mirror of https://github.com/flutter/samples.git
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.
29 lines
990 B
29 lines
990 B
import 'package:compass_app/domain/models/itinerary_config/itinerary_config.dart';
|
|
import 'package:compass_app/ui/results/view_models/results_viewmodel.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import '../../../testing/fakes/repositories/fake_destination_repository.dart';
|
|
import '../../../testing/fakes/repositories/fake_itinerary_config_repository.dart';
|
|
|
|
void main() {
|
|
group('ResultsViewModel tests', () {
|
|
final viewModel = ResultsViewModel(
|
|
destinationRepository: FakeDestinationRepository(),
|
|
itineraryConfigRepository: FakeItineraryConfigRepository(
|
|
itineraryConfig: ItineraryConfig(
|
|
continent: 'Europe',
|
|
startDate: DateTime(2024, 01, 01),
|
|
endDate: DateTime(2024, 01, 31),
|
|
guests: 2,
|
|
),
|
|
),
|
|
);
|
|
|
|
// perform a simple test
|
|
// verifies that the list of items is properly loaded
|
|
test('should load items', () async {
|
|
expect(viewModel.destinations.length, 2);
|
|
});
|
|
});
|
|
}
|