public void ToStringShouldWork(double value, string expected) { var original = new RelativeHumidity(value); var actual = original.ToString(); Assert.That(actual, Is.EqualTo(expected)); }
public static IHumidity Parse(double value, string type) { IHumidity result; switch (type.ToLower()) { case "%": case "percent": result = new RelativeHumidity(value); break; default: throw new Exception("Could not determine type " + type); } return result; }