Esempio n. 1
0
 public void Seconds_Parse_string_ReturnsTrue()
 {
     try
     {
         Seconds sec = Seconds.Parse("12.345i");
         Assert.Fail("no exception thrown");
     }
     catch (FormatException ex)
     {
         Assert.IsTrue(ex is FormatException);
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
Esempio n. 2
0
        public void Seconds_Parse_string2_ReturnsTrue()
        {
            Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            Seconds deg = new Seconds(55.55);

            Seconds secTest1 = Seconds.Parse("55.55\"");

            Assert.IsTrue(deg == secTest1, "Parse string 55.55\" " + secTest1);

            Seconds secTest2 = Seconds.Parse("55.55s");

            Assert.IsTrue(deg == secTest2, "Parse string 55.55s " + secTest2);

            Seconds secTest3 = Seconds.Parse("55.55S");

            Assert.IsTrue(deg == secTest3, "Parse string 55.55S " + secTest3);
        }
Esempio n. 3
0
        public void Seconds_Parse_ToString_ReturnsTrue()
        {
            Seconds sec = new Seconds(55.55);

            Assert.IsTrue(sec == Seconds.Parse(sec.ToString()));
        }