add test for MarshalJSON

This commit is contained in:
Kent Gruber 2018-05-01 22:37:40 -04:00
commit dfa55d2a2e

View file

@ -30,3 +30,14 @@ func TestNewWiFi(t *testing.T) {
t.Error("unable to build net wifi struct")
}
}
func TestWiFiMarshalJSON(t *testing.T) {
exampleWiFi := buildExampleWiFi()
json, err := exampleWiFi.MarshalJSON()
if err != nil {
t.Error(err)
}
if len(json) <= 0 {
t.Error("unable to marshal JSON from WiFi struct")
}
}