public void Raised()
        {
            var mc = new MyClass(true);

            RunTest(AnyValue.IsValid,
                    () => mc.Method(),
                    SmartAssert.Raised("MyEvent"));
        }
        public void Raised()
        {
            var mc = new MyClass(true);

            var raised = false;

            RunTest(AnyValue.IsValid,
                    () => mc.Method(),
                    SmartAssert.Raised <EventArgs>("MyEvent", (sender, args) => raised = true));
            Assert.IsTrue(raised);
        }
        public void NotRaised()
        {
            var exception = Assert.Catch <SmartTestException>(() =>
            {
                var mc = new MyClass(false);

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

            Assert.AreEqual("Event 'EventHandlerTestsImplicit+MyClass.MyEvent' was expected", exception.Message);
        }
        public void NotEvent()
        {
            var exception = Assert.Catch <BadTestException>(() =>
            {
                var mc = new MyClass(true);

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

            Assert.AreEqual("BAD TEST: 'NotEvent' is not an event of type 'EventHandlerTestsImplicit+MyClass'", exception.Message);
        }
        public void NotRaised()
        {
            var raised    = false;
            var exception = Assert.Catch <SmartTestException>(() =>
            {
                var mc = new MyClass(false);

                RunTest(AnyValue.IsValid,
                        () => mc.Method(),
                        SmartAssert.Raised <EventArgs>("MyEvent", (sender, args) => raised = true));
            });

            Assert.AreEqual("Event 'EventHandlerTestsAssertImplicit+MyClass.MyEvent' was expected", exception.Message);
            Assert.IsFalse(raised);
        }