Example #1
0
        public void Raise_Generic()
        {
            bool eventFired = false;
            var foo = new Foo();

            foo.MyGenericEvent += (sender, args) =>
            {
                eventFired = true;
                Assert.AreEqual(foo, sender);
                Assert.AreEqual("Custom", ((MyEventArgs)args).CustomProperty);
            };

            foo.FireGenericEvent();

            Assert.IsTrue(eventFired);
        }