// check the RegisterDevice method func testCheckRegisterDevice(t *testing.T, service Service, device core.Device, suffix string) { if service == nil { return // do nothing } device.Id += suffix if len(device.Key) != 0 { device.Key += suffix } device.Name += suffix // create new device testCheckRegisterDevice1(t, service, device, true) testCheckGetDevice(t, service, device) // change some data device.Data = "new data" device.Status = "Bad" device.Name += "-new" // update device testCheckRegisterDevice1(t, service, device, false) testCheckGetDevice(t, service, device) }