-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b8f302
commit 5d105b0
Showing
10 changed files
with
333 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
import 'package:koja/Utils/event_data_source_util.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:koja/Utils/event_util.dart'; | ||
|
||
void main(){ | ||
var timeFrom = DateTime.now(); | ||
var timeTo = DateTime(2024); | ||
var event = Event(title: 'School', from: timeFrom, to: timeTo); | ||
var event2 = Event(title: 'Work', from: timeFrom, to: timeTo); | ||
// var timeFrom = DateTime.now(); | ||
// var timeTo = DateTime(2024); | ||
// var event = Event(title: 'School', from: timeFrom, to: timeTo); | ||
// var event2 = Event(title: 'Work', from: timeFrom, to: timeTo); | ||
|
||
group('Event Data Source Util', () { | ||
List<Event> eventList = []; | ||
test('The event list is empty', (){ | ||
expect(eventList.isEmpty, true); | ||
}); | ||
// group('Event Data Source Util', () { | ||
// List<Event> eventList = []; | ||
// test('The event list is empty', (){ | ||
// expect(eventList.isEmpty, true); | ||
// }); | ||
|
||
|
||
test('The event list is not empty', () { | ||
eventList.addAll({event, event2}); | ||
expect(eventList.isEmpty, false); | ||
}); | ||
var eventDataSource = EventDataSource(eventList); | ||
test('It returns the correct events', (){ | ||
var result1 = eventDataSource.getEvent(0); | ||
var result2 = eventDataSource.getEvent(1); | ||
expect(result1, event); | ||
expect(result2, event2); | ||
}); | ||
// test('The event list is not empty', () { | ||
// eventList.addAll({event, event2}); | ||
// expect(eventList.isEmpty, false); | ||
// }); | ||
// var eventDataSource = EventDataSource(eventList); | ||
// test('It returns the correct events', (){ | ||
// var result1 = eventDataSource.getEvent(0); | ||
// var result2 = eventDataSource.getEvent(1); | ||
// expect(result1, event); | ||
// expect(result2, event2); | ||
// }); | ||
|
||
test('The events return correct data', () { | ||
expect(eventDataSource.getSubject(0), event.title); | ||
expect(eventDataSource.getStartTime(0), event.from); | ||
expect(eventDataSource.getEndTime(0), event.to); | ||
expect(eventDataSource.getLocation(0), event.location); | ||
expect(eventDataSource.getCategory(0), event.category); | ||
expect(eventDataSource.getColor(0), event.backgroundColor); | ||
expect(eventDataSource.isAllDay(0), event.isAllDay); | ||
}); | ||
}); | ||
// test('The events return correct data', () { | ||
// expect(eventDataSource.getSubject(0), event.title); | ||
// expect(eventDataSource.getStartTime(0), event.from); | ||
// expect(eventDataSource.getEndTime(0), event.to); | ||
// expect(eventDataSource.getLocation(0), event.location); | ||
// expect(eventDataSource.getCategory(0), event.category); | ||
// expect(eventDataSource.getColor(0), event.backgroundColor); | ||
// expect(eventDataSource.isAllDay(0), event.isAllDay); | ||
// }); | ||
// }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:koja/Utils/event_util.dart'; | ||
|
||
void main() { | ||
test('Event test', () { | ||
// Create a sample userEvent | ||
final userEvent = Event( | ||
title: 'Meeting', | ||
description: 'Team meeting', | ||
location: 'Conference Room', | ||
from: DateTime(2023, 5, 22, 14, 30), | ||
to: DateTime(2023, 5, 22, 16, 0), | ||
backgroundColor: Colors.red, | ||
isAllDay: false, | ||
); | ||
// test('Event test', () { | ||
// // Create a sample userEvent | ||
// final userEvent = Event( | ||
// title: 'Meeting', | ||
// description: 'Team meeting', | ||
// location: 'Conference Room', | ||
// from: DateTime(2023, 5, 22, 14, 30), | ||
// to: DateTime(2023, 5, 22, 16, 0), | ||
// backgroundColor: Colors.red, | ||
// isAllDay: false, | ||
// ); | ||
|
||
// Test the properties of the userEvent | ||
expect(userEvent.title, equals('Meeting')); | ||
expect(userEvent.description, equals('Team meeting')); | ||
expect(userEvent.location, equals('Conference Room')); | ||
expect(userEvent.from, equals(DateTime(2023, 5, 22, 14, 30))); | ||
expect(userEvent.to, equals(DateTime(2023, 5, 22, 16, 0))); | ||
expect(userEvent.backgroundColor, equals(Colors.red)); | ||
expect(userEvent.isAllDay, equals(false)); | ||
}); | ||
// // Test the properties of the userEvent | ||
// expect(userEvent.title, equals('Meeting')); | ||
// expect(userEvent.description, equals('Team meeting')); | ||
// expect(userEvent.location, equals('Conference Room')); | ||
// expect(userEvent.from, equals(DateTime(2023, 5, 22, 14, 30))); | ||
// expect(userEvent.to, equals(DateTime(2023, 5, 22, 16, 0))); | ||
// expect(userEvent.backgroundColor, equals(Colors.red)); | ||
// expect(userEvent.isAllDay, equals(false)); | ||
// }); | ||
} |
Oops, something went wrong.