Skip to content

Commit e50131a

Browse files
committed
- [+] add test/Schedules
1 parent 5e3ecde commit e50131a

File tree

8 files changed

+171
-25
lines changed

8 files changed

+171
-25
lines changed

jsonfiddle_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,19 @@ func TestExec(t *testing.T) {
6262

6363
// == Test Basic Functions
6464
// -- fmt
65-
testIt(t, "Customer", "fmt", "-c", "-i", "Customer.json")
66-
testIt(t, "CustomerI", "fmt", "-i", "Customer.json")
65+
testIt(t, "CustomerC", "fmt", "-c", "-i", "Customer.json")
66+
testIt(t, "Customer", "fmt", "-i", "Customer.json")
67+
testIt(t, "Schedules", "fmt", "-i", "Schedules.json")
6768
// -- sort
6869
testIt(t, "CustomerSI", "sort", "-i", "Customer.json")
6970
testIt(t, "CustomerSC", "sort", "-c", "-i", "Customer.json")
71+
testIt(t, "SchedulesSI", "sort", "-i", "Schedules.json")
7072
// -- j2s
7173
testIt(t, "CustomerJ2S", "j2s", "-i", "Customer.json")
7274
testIt(t, "GoodsJ2S", "j2s", "-i", "Goods.json")
7375
testIt(t, "MenuItemsJ2S", "j2s", "-i", "MenuItems.json")
7476
testIt(t, "SmartyStreetsJ2S", "j2s", "-i", "SmartyStreets.json")
77+
testIt(t, "SchedulesJ2S", "j2s", "-i", "Schedules.json")
7578

7679
//Test String Functions
7780

test/Customer.ref

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/Customer.ref

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"firstName": "John",
3+
"lastName": "Smith",
4+
"age": 25,
5+
"address": {
6+
"streetAddress": "21 2nd Street",
7+
"city": "New York",
8+
"state": "NY",
9+
"postalCode": "10021"
10+
},
11+
"phoneNumber": [
12+
{
13+
"type": "home",
14+
"number": "212 555-1234"
15+
},
16+
{
17+
"type": "fax",
18+
"number": "646 555-4567"
19+
}
20+
]
21+
}
22+

test/CustomerC.ref

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Customer.json

test/CustomerI.ref

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/Schedules.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"DaysCfg":{"Range":{"lowerDate":"2017-07-28T00:00:00.000-04:00","upperDate":"2017-08-04T00:00:00.000-04:00"},"DaysInPeriod":8,"DaysToSchedule":[0,1,2,3,4,5,6]},"DepartmentsID":[138837,139734,141934,142436,149687,151049],"EmployeesID":[5039,5170,5889,6051,6236,7208,7281,8776,8781,8936,9261],"EndDate":"2017-08-03T23:59:00.000-04:00","IntervalSize":15,"IsActivitiesEnabled":true,"ModifyExisting":false,"OrignId":134721,"PrimaryOption":0,"SchoolDays":[],"ScheduleChanges":[],"StartDate":"2017-07-28T00:00:00.000-04:00","ZonesToSchedule":[5,4,6,3,3,3,2,14]}

test/Schedules.ref

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"DaysCfg": {
3+
"Range": {
4+
"lowerDate": "2017-07-28T00:00:00.000-04:00",
5+
"upperDate": "2017-08-04T00:00:00.000-04:00"
6+
},
7+
"DaysInPeriod": 8,
8+
"DaysToSchedule": [
9+
0,
10+
1,
11+
2,
12+
3,
13+
4,
14+
5,
15+
6
16+
]
17+
},
18+
"DepartmentsID": [
19+
138837,
20+
139734,
21+
141934,
22+
142436,
23+
149687,
24+
151049
25+
],
26+
"EmployeesID": [
27+
5039,
28+
5170,
29+
5889,
30+
6051,
31+
6236,
32+
7208,
33+
7281,
34+
8776,
35+
8781,
36+
8936,
37+
9261
38+
],
39+
"EndDate": "2017-08-03T23:59:00.000-04:00",
40+
"IntervalSize": 15,
41+
"IsActivitiesEnabled": true,
42+
"ModifyExisting": false,
43+
"OrignId": 134721,
44+
"PrimaryOption": 0,
45+
"SchoolDays": [],
46+
"ScheduleChanges": [],
47+
"StartDate": "2017-07-28T00:00:00.000-04:00",
48+
"ZonesToSchedule": [
49+
5,
50+
4,
51+
6,
52+
3,
53+
3,
54+
3,
55+
2,
56+
14
57+
]
58+
}

test/SchedulesJ2S.ref

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package main
2+
3+
type Schedules struct {
4+
DaysCfg struct {
5+
DaysInPeriod int64 `json:"DaysInPeriod"`
6+
DaysToSchedule []int64 `json:"DaysToSchedule"`
7+
Range struct {
8+
LowerDate string `json:"lowerDate"`
9+
UpperDate string `json:"upperDate"`
10+
} `json:"Range"`
11+
} `json:"DaysCfg"`
12+
DepartmentsID []int64 `json:"DepartmentsID"`
13+
EmployeesID []int64 `json:"EmployeesID"`
14+
EndDate string `json:"EndDate"`
15+
IntervalSize int64 `json:"IntervalSize"`
16+
IsActivitiesEnabled bool `json:"IsActivitiesEnabled"`
17+
ModifyExisting bool `json:"ModifyExisting"`
18+
OrignID int64 `json:"OrignId"`
19+
PrimaryOption int64 `json:"PrimaryOption"`
20+
ScheduleChanges []interface{} `json:"ScheduleChanges"`
21+
SchoolDays []interface{} `json:"SchoolDays"`
22+
StartDate string `json:"StartDate"`
23+
ZonesToSchedule []int64 `json:"ZonesToSchedule"`
24+
}
25+

test/SchedulesSI.ref

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"DaysCfg": {
3+
"DaysInPeriod": 8,
4+
"DaysToSchedule": [
5+
0,
6+
1,
7+
2,
8+
3,
9+
4,
10+
5,
11+
6
12+
],
13+
"Range": {
14+
"lowerDate": "2017-07-28T00:00:00.000-04:00",
15+
"upperDate": "2017-08-04T00:00:00.000-04:00"
16+
}
17+
},
18+
"DepartmentsID": [
19+
138837,
20+
139734,
21+
141934,
22+
142436,
23+
149687,
24+
151049
25+
],
26+
"EmployeesID": [
27+
5039,
28+
5170,
29+
5889,
30+
6051,
31+
6236,
32+
7208,
33+
7281,
34+
8776,
35+
8781,
36+
8936,
37+
9261
38+
],
39+
"EndDate": "2017-08-03T23:59:00.000-04:00",
40+
"IntervalSize": 15,
41+
"IsActivitiesEnabled": true,
42+
"ModifyExisting": false,
43+
"OrignId": 134721,
44+
"PrimaryOption": 0,
45+
"ScheduleChanges": [],
46+
"SchoolDays": [],
47+
"StartDate": "2017-07-28T00:00:00.000-04:00",
48+
"ZonesToSchedule": [
49+
5,
50+
4,
51+
6,
52+
3,
53+
3,
54+
3,
55+
2,
56+
14
57+
]
58+
}
59+

0 commit comments

Comments
 (0)