Commit d989003f authored by HellLab's avatar HellLab
Browse files

update test

parent f91933aa
import 'package:demo/src/view/services/appointment_service.dart';
import 'package:demo/src/view/services/person_service.dart';
import 'package:test/test.dart';
import 'package:demo/src/model/day.dart';
import 'package:demo/src/model/month.dart';
import 'package:demo/src/model/appointment.dart';
import 'package:demo/src/model/person.dart';
void main() {
Future main() async {
Day day;
Day day2;
......@@ -45,6 +48,7 @@ void main() {
});
///Tests for appointment.dart
AppointmentService appointmentService;
Appointment appo =
Appointment(1, "Abifaier", 2019, 6, 4, "2", "4", "Lübeck", "hi");
Appointment json = Appointment.zero();
......@@ -53,7 +57,15 @@ void main() {
expect(appo.equals(Appointment.fromJson(appo.toJson())), true);
});
await appointmentService.update(appo);
List<Appointment> appointments= await appointmentService.getByDate(appo.year, appo.month,appo.day);
test("AppointmentService.update appointment.getByDate",() async {
expect(appointments.contains(appo), true);
});
///Tests for person.dart
UserService userService;
User user = User(1,'CC123', 'Hellbender', 'Schindler', 'Laurenz',
'Hallo@myWebmail.com', 'dasisteinschlechtesPasswort', '016331742');
Contact contact = Contact(2,'Xanta', 'Waage', 'Daniel',
......@@ -65,4 +77,6 @@ void main() {
test("Contact.toJson == Contact.FromJson", () {
expect(contact.equals(Contact.fromJson(contact.toJson())), true);
});
}
import 'harness/app.dart';
main() async {
final harness = Harness()..install();
test("GET /heroes returns 200 {'key': 'value'}", () async {
expectResponse(await harness.agent.get("/heroes"), 200, body: {"key": "value"});
});
/*
test("Day.isValid(), checks for a valid day", () {
day = Day(2010,11,11);
expect(day.isValid(), true);
});
*/
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment