public async void SubscribeToSensor_Connection_Fails_ReturnNull() { Transmitter transmitter = new Transmitter(transmitterId); transmitter.ConnectToBroker("hello", transmitterSecret); Device device = await transmitter.SubscribeToDeviceDataAsync("asdasd33"); //Assert.IsNull(device); }
public async void SubscribeToSensor_Connection_Successful_ReturnDevice() { Transmitter transmitter = new Transmitter(transmitterId); transmitter.ConnectToBroker("hello", transmitterSecret); Device device = await transmitter.SubscribeToDeviceDataAsync("d1fa0703-36bb-4694-8db1-a71becc9d489"); Assert.IsNotNull(device); }
public void SubscribeToSensor_Empty_DeviceId_ThrowException() { try { Transmitter transmitter = new Transmitter(transmitterId); transmitter.ConnectToBroker("hello", transmitterSecret); transmitter.SubscribeToDeviceDataAsync(""); Assert.Fail(); } catch (ArgumentException e) { } }