Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mauritz, Falk Marius
SWTII Cal
Commits
829a6fb5
Commit
829a6fb5
authored
Jun 09, 2019
by
HellLab
Browse files
update test
parent
d989003f
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/test/test.dart
View file @
829a6fb5
...
...
@@ -7,7 +7,7 @@ import 'package:demo/src/model/month.dart';
import
'package:demo/src/model/appointment.dart'
;
import
'package:demo/src/model/person.dart'
;
Future
main
(
)
async
{
Future
main
(
)
{
Day
day
;
Day
day2
;
...
...
@@ -48,21 +48,43 @@ Future main() async {
});
///Tests for appointment.dart
List
<
Appointment
>
appointments
;
AppointmentService
appointmentService
;
Appointment
appo
=
Appointment
(
1
,
"Abifaier"
,
2019
,
6
,
4
,
"2"
,
"
4
"
,
"Lübeck"
,
"hi"
);
Appointment
(
1
,
"Abifaier"
,
2019
,
6
,
4
,
"2
:30
"
,
""
,
"Lübeck"
,
"hi"
);
Appointment
json
=
Appointment
.
zero
();
test
(
"Appointment appointment.fromJson"
,
()
{
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
{
///Datenbank tests für AppointmentService
test
(
"AppointmentService.creat appointment.getByDate"
,()
async
{
await
appointmentService
.
create
(
appo
);
appointments
=
await
appointmentService
.
getByDate
(
appo
.
year
,
appo
.
month
,
appo
.
day
);
expect
(
appointments
.
contains
(
appo
),
true
);
});
test
(
"AppointmentService.update appointment.getByDate"
,()
async
{
appointments
=
await
appointmentService
.
getByDate
(
appo
.
year
,
appo
.
month
,
appo
.
day
);
int
length
=
appointments
.
length
;
await
appointmentService
.
update
(
Appointment
(
1
,
"KiezTour"
,
2019
,
6
,
4
,
"22:30"
,
""
,
"Hamburg"
,
"Lass mal nicht so spät anfangen."
));
appointments
=
await
appointmentService
.
getByDate
(
appo
.
year
,
appo
.
month
,
appo
.
day
);
expect
(
appointments
.
length
,
length
);
});
test
(
"AppointmentService.delet getAll"
,()
async
{
appointments
=
await
appointmentService
.
getAll
();
int
length
=
appointments
.
length
;
appointmentService
.
delete
(
appointments
.
last
.
id
);
appointments
=
await
appointmentService
.
getAll
();
expect
(
appointments
.
length
+
1
,
length
);
});
test
(
"AppointmentService.creat search"
,()
async
{
await
appointmentService
.
create
(
appo
);
appointments
=
await
appointmentService
.
search
(
appo
.
name
);
expect
(
appointments
.
contains
(
appo
),
true
);
});
///Tests for person.dart
UserService
userService
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment