Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
d989003f
Commit
d989003f
authored
Jun 09, 2019
by
HellLab
Browse files
update test
parent
f91933aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/test/
frontend_
test.dart
→
frontend/test/test.dart
View file @
d989003f
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
);
});
}
middleman/test/example_test.dart
deleted
100644 → 0
View file @
f91933aa
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);
});
*/
}
Write
Preview
Markdown
is supported
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