Exemple #1
0
        public void EventNullTest()
        {
            var obj = new ModelClass()
            {
                Property     = 12,
                PropertyLink = "asd"
            };

            try
            {
                obj.Property = 14;
                obj.Initialize();
                obj.FinalizeObject();
                obj.Dispose();
            }
            catch (NullReferenceException)
            {
                throw new Exception("TestFailed.. NullReferenceException");
            }
        }
Exemple #2
0
        public void FinalizeTest()
        {
            var obj = new ModelClass
            {
                Property = 1231
            };

            obj.FinalizeObject();

            try
            {
                obj.Property = 12314;
            }
            catch (Exception)
            {
                Assert.AreEqual(obj.Property, 1231, $"Property value changed");

                return;
            }

            throw new Exception("Exception hasn't throwed");
        }