This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unmarshal function for 2017-07-01, with TODO comments
- Loading branch information
Jingtao Ren
committed
Jul 8, 2017
1 parent
117b4e3
commit 9384fc5
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package v20170701 | ||
|
||
import ( | ||
"encoding/json" | ||
"testing" | ||
) | ||
|
||
func TestMasterProfile(t *testing.T) { | ||
MasterProfileText := "{\"count\" : 0}" | ||
mp := &MasterProfile{} | ||
if e := json.Unmarshal([]byte(MasterProfileText), mp); e != nil { | ||
t.Fatalf("unexpectedly detected unmarshal failure for MasterProfile, %+v", e) | ||
} | ||
|
||
if mp.Count != 1 { | ||
t.Fatalf("unexpectedly detected MasterProfile.Count != 1 after unmarshal") | ||
} | ||
} | ||
|
||
func TestAgentPoolProfile(t *testing.T) { | ||
// With osType not specified | ||
AgentPoolProfileText := "{\"count\" : 0}" | ||
ap := &AgentPoolProfile{} | ||
if e := json.Unmarshal([]byte(AgentPoolProfileText), ap); e != nil { | ||
t.Fatalf("unexpectedly detected unmarshal failure for AgentPoolProfile, %+v", e) | ||
} | ||
|
||
if ap.Count != 1 { | ||
t.Fatalf("unexpectedly detected AgentPoolProfile.Count != 1 after unmarshal") | ||
} | ||
|
||
if ap.OSType != Linux { | ||
t.Fatalf("unexpectedly detected AgentPoolProfile.OSType != Linux after unmarshal") | ||
} | ||
} |