Exemple #1
0
        public void ParseTest_ReferenceEquals()
        {
            var a = (ColorWithImplicitParse)"red";
            var b = ColorWithImplicitParse.Parse("red", false);
            var c = ColorWithImplicitParse.Parse("Red", true);
            var d = ColorWithImplicitParse.Red;

            Assert.IsTrue(object.ReferenceEquals(a, b));
            Assert.IsTrue(object.ReferenceEquals(a, c));
            Assert.IsTrue(object.ReferenceEquals(a, d));
        }
Exemple #2
0
 public void ParseTest_CaseInsensitiveShouldFail()
 {
     ColorWithImplicitParse a = ColorWithImplicitParse.Parse("not a color");
 }