Beispiel #1
0
        public void Gradians_Parse_string2_ReturnsTrue()
        {
            Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            Gradians deg = new Gradians(55.55);

            Gradians degTest1 = Gradians.Parse("55.55g");

            Assert.IsTrue(deg == degTest1, "Parse string 55.55g " + degTest1);

            Gradians degTest2 = Gradians.Parse("55.55G");

            Assert.IsTrue(deg == degTest2, "Parse string 55.55G " + degTest2);
        }
Beispiel #2
0
        public void Gradians_Parse_string_ReturnsTrue()
        {
            Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            try
            {
                Gradians gon = Gradians.Parse("12.345i");
                Assert.Fail("no exception thrown");
            }
            catch (FormatException ex)
            {
                Assert.IsTrue(ex is FormatException);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Beispiel #3
0
        public void Gradians_Parse_ToString_ReturnsTrue()
        {
            Gradians gon = new Gradians(55.55);

            Assert.IsTrue(gon == Gradians.Parse(gon.ToString()));
        }