Exemple #1
0
        public void ParseTest()
        {
            Assert.AreEqual(new Pointd(0, 0), Pointd.Parse("0,0"));
            Assert.AreEqual(new Pointd(0, 0), Pointd.Parse(" 0 , 0 "));
            Assert.AreEqual(new Pointd(-93.9, 590), Pointd.Parse("-93.9,590"));
            Assert.AreEqual(new Pointd(-1E-5, 555.87), Pointd.Parse("-1E-5,+555.87"));

            Assert.Catch <ArgumentNullException>(() => Pointd.Parse(null));
            Assert.Catch <FormatException>(() => Pointd.Parse(""));
            Assert.Catch <FormatException>(() => Pointd.Parse("test"));
            Assert.Catch <FormatException>(() => Pointd.Parse("4,"));
            Assert.Catch <FormatException>(() => Pointd.Parse("-5,-9d"));
        }