예제 #1
0
        public void GetSensor()
        {
            var currentSensor = JObject.Parse(
                @"{
                    'Name':'Nice',
                    'Type':'Temperature',
                    'RoomId':'1234'
                    }"
                );

            var result = _json.GetSensor(currentSensor);

            var expected = new Sensor();

            expected.Name   = "Nice";
            expected.Type   = "Temperature";
            expected.RoomId = "1234";

            Assert.Equal(expected.Name, result.Name);
            Assert.Equal(expected.Type, result.Type);
            Assert.Equal(expected.RoomId, result.RoomId);
        }