예제 #1
0
        public void StringInReverseOrder()
        {
            const string        InvalidTempFormat = "HUMIDITY_BEGIN40HUMIDITY_ENDTEMP_BEGIN-30TEMP_ENDPRESSURE_BEGIN20PRESSURE_END";
            IReceivedDataParser testParser        = new ReceivedDataParser();

            testParser.tryParseString(InvalidTempFormat);

            Assert.AreEqual(testParser.getPressure(), 20);
            Assert.AreEqual(testParser.getTemperature(), -30);
            Assert.AreEqual(testParser.getHumidity(), 40);
        }
예제 #2
0
        public void StringWithAllNegativeValues()
        {
            const string        InvalidTempFormat = "PRESSURE_BEGIN-20PRESSURE_ENDTEMP_BEGIN-30TEMP_ENDHUMIDITY_BEGIN-40HUMIDITY_END";
            IReceivedDataParser testParser        = new ReceivedDataParser();

            testParser.tryParseString(InvalidTempFormat);

            Assert.AreEqual(testParser.getPressure(), -20);
            Assert.AreEqual(testParser.getTemperature(), -30);
            Assert.AreEqual(testParser.getHumidity(), -40);
        }