コード例 #1
0
        public void UnexpectedNotRaised()
        {
            var mc = new MyClass(false);

            RunTest(AnyValue.IsValid,
                    () => mc.Method(),
                    SmartAssert.NotRaised("MyEvent"));
        }
コード例 #2
0
        public void UnexpectedRaised()
        {
            var exception = Assert.Catch <SmartTestException>(() =>
            {
                var mc = new MyClass(true);

                RunTest(AnyValue.IsValid,
                        () => mc.Method(),
                        SmartAssert.NotRaised("MyEvent"));
            });

            Assert.AreEqual("Event 'EventHandlerTestsImplicit+MyClass.MyEvent' was unexpected", exception.Message);
        }
コード例 #3
0
        public void UnexpectedNotEvent()
        {
            var exception = Assert.Catch <BadTestException>(() =>
            {
                var mc = new MyClass(true);

                RunTest(AnyValue.IsValid,
                        () => mc.Method(),
                        SmartAssert.NotRaised("NotEvent"));
            });

            Assert.AreEqual("BAD TEST: 'NotEvent' is not an event of type 'EventHandlerTestsImplicit+MyClass'", exception.Message);
        }