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); }
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); }