public void StringWithInvalidHumidity() { const string InvalidTempFormat = "PRESSURE_BEGIN20PRESSURE_ENDTEMP_BEGIN20TEMP_ENDHUMIDITY_BEGINasdddHUMIDITY_END"; IReceivedDataParser testParser = new ReceivedDataParser(); testParser.tryParseString(InvalidTempFormat); }
public void StringWithInvalidPressure() { const string InvalidTempFormat = "PRESSURE_BEGINasddaqwPRESSURE_ENDTEMP_BEGIN20TEMP_ENDHUMIDITY_BEGIN1233HUMIDITY_END"; IReceivedDataParser testParser = new ReceivedDataParser(); testParser.tryParseString(InvalidTempFormat); }
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); }