コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public void SubscribeToSensor_Empty_DeviceId_ThrowException()
        {
            try
            {
                Transmitter transmitter = new Transmitter(transmitterId);
                transmitter.ConnectToBroker("hello", transmitterSecret);
                transmitter.SubscribeToDeviceDataAsync("");
                Assert.Fail();
            }
            catch (ArgumentException e)
            {

            }
        }