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