public void Degrees_Parse_string_ReturnsTrue() { try { Degrees deg = Degrees.Parse("12.345i"); Assert.Fail("no exception thrown"); } catch (FormatException ex) { Assert.IsTrue(ex is FormatException); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void Degrees_Parse_string2_ReturnsTrue() { Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; Degrees deg = new Degrees(55.55); Degrees degTest1 = Degrees.Parse("55.55°"); Assert.IsTrue(deg == degTest1, "Parse string 55.55° " + degTest1); Degrees degTest2 = Degrees.Parse("55.55d"); Assert.IsTrue(deg == degTest2, "Parse string 55.55d " + degTest2); Degrees degTest3 = Degrees.Parse("55.55D"); Assert.IsTrue(deg == degTest3, "Parse string 55.55D " + degTest3); }
public void Degrees_Parse_ToString_ReturnsTrue() { Degrees deg = new Degrees(55.55); Assert.IsTrue(deg == Degrees.Parse(deg.ToString())); }