@@ -8,15 +8,20 @@ import (
8
8
"testing"
9
9
)
10
10
11
- //Define struct (AdressNr as string just for convenience)
11
+ // Define struct (AdressNr as string just for convenience)
12
12
type Adresse struct {
13
13
AdressNr string `json:"AdressNr,omitempty"`
14
14
Name string `json:"Name,omitempty"`
15
15
Ort string `json:"Ort,omitempty"`
16
16
PLZ string `json:"PLZ,omitempty"`
17
+ Land Land `json:"Land,omitempty"`
17
18
}
18
19
19
- //Connect function
20
+ type Land struct {
21
+ LandNr string `json:"LandNr,omitempty"`
22
+ }
23
+
24
+ // Connect function
20
25
func ConnectTest (modules []string ) (pxrest * Client , err error ) {
21
26
22
27
//Use PROFFIX Public Demo Login as Example (REMOVED - As offical demo often is outdated)
@@ -46,7 +51,7 @@ func ConnectTest(modules []string) (pxrest *Client, err error) {
46
51
return pxrest , err
47
52
}
48
53
49
- //Helper function for checking if is type Options
54
+ // Helper function for checking if is type Options
50
55
func isOption (t interface {}) bool {
51
56
switch t .(type ) {
52
57
case Options :
@@ -56,7 +61,7 @@ func isOption(t interface{}) bool {
56
61
}
57
62
}
58
63
59
- //Helper function for checking if is type Client
64
+ // Helper function for checking if is type Client
60
65
func isClient (t interface {}) bool {
61
66
switch t .(type ) {
62
67
case Client :
@@ -66,7 +71,7 @@ func isClient(t interface{}) bool {
66
71
}
67
72
}
68
73
69
- //Test all Requests in one Session
74
+ // Test all Requests in one Session
70
75
func TestClient_Requests (t * testing.T ) {
71
76
72
77
//New Context
@@ -75,7 +80,7 @@ func TestClient_Requests(t *testing.T) {
75
80
//POST TESTs
76
81
77
82
//Fill struct with Demo Data
78
- var data = Adresse {Name : "Muster GmbH" , Ort : "Zürich" , PLZ : "8000" }
83
+ var data = Adresse {Name : "Muster GmbH" , Ort : "Zürich" , PLZ : "8000" , Land : Land { LandNr : "CH" } }
79
84
80
85
//Connect
81
86
pxrest , _ := ConnectTest ([]string {"VOL" })
@@ -206,7 +211,7 @@ func TestClient_Requests(t *testing.T) {
206
211
207
212
}
208
213
209
- //Test all Requests in one Session
214
+ // Test all Requests in one Session
210
215
func TestClient_AdvancedFilters (t * testing.T ) {
211
216
212
217
//New Context
@@ -277,7 +282,7 @@ func TestClient_AdvancedFilters(t *testing.T) {
277
282
278
283
}
279
284
280
- //Test Get Database with Key from Options
285
+ // Test Get Database with Key from Options
281
286
func TestGetDatabase (t * testing.T ) {
282
287
283
288
//New Context
@@ -318,7 +323,7 @@ func TestGetDatabase(t *testing.T) {
318
323
}
319
324
}
320
325
321
- //Test Get Info with Key set in Function
326
+ // Test Get Info with Key set in Function
322
327
func TestGetInfo (t * testing.T ) {
323
328
324
329
//New Context
@@ -352,7 +357,7 @@ func TestGetInfo(t *testing.T) {
352
357
353
358
}
354
359
355
- //Check structs
360
+ // Check structs
356
361
func TestStructs (t * testing.T ) {
357
362
358
363
//New Context
0 commit comments