Exemplo n.º 1
0
        public void TestSetPropertySuccess()
        {
            var c = new InvariantClass();

            c.MyProperty = "Value";
            Assert.AreEqual("Value", c.MyProperty);
        }
Exemplo n.º 2
0
        public void TestSetFieldSuccess()
        {
            var c = new InvariantClass();

            c.SetMyInt(4);
            Assert.AreEqual(4, c.GetMyInt());
            c.SetMyInt(6);
            Assert.AreEqual(6, c.GetMyInt());
        }
Exemplo n.º 3
0
 public void TestSetPropertyViolateInvariantCtor()
 {
     var c = new InvariantClass {
         MyProperty = null
     };
 }
Exemplo n.º 4
0
        public void TestSetPropertyViolateInvariant()
        {
            var c = new InvariantClass();

            c.MyProperty = null;
        }
Exemplo n.º 5
0
        public void TestSetFieldViolateInvariant()
        {
            var c = new InvariantClass();

            c.SetMyInt(5);
        }