Beispiel #1
0
        public void TestSetPropertySuccess()
        {
            var c = new InvariantClass();

            c.MyProperty = "Value";
            Assert.AreEqual("Value", c.MyProperty);
        }
Beispiel #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());
        }
Beispiel #3
0
 public void TestSetPropertyViolateInvariantCtor()
 {
     var c = new InvariantClass {
         MyProperty = null
     };
 }
Beispiel #4
0
        public void TestSetPropertyViolateInvariant()
        {
            var c = new InvariantClass();

            c.MyProperty = null;
        }
Beispiel #5
0
        public void TestSetFieldViolateInvariant()
        {
            var c = new InvariantClass();

            c.SetMyInt(5);
        }