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