[TestMethod()] // F to K public void Zero_FahrenheitToKelvinTest() { float fahrenheit = -459.67f; float expected = 0.00f; TempConvert convert = new TempConvert(); float actual = float.Parse(convert.FahrenheitToKelvin(fahrenheit).ToString("n2")); Assert.AreEqual(expected, actual); }
[TestMethod()] // F to K public void Boiling_FahrenheitToKelvinTest() { float fahrenheit = 212.00f; float expected = 373.15f; TempConvert convert = new TempConvert(); float actual = float.Parse(convert.FahrenheitToKelvin(fahrenheit).ToString("n2")); Assert.AreEqual(expected, actual); }
public float FahrenheitToKelvin(float temp) { return(TempConvert.FahrenheitToKelvin(temp)); }