public void Notify_GivenDelegate_Success()
        {
            ButtonWithDelegates button = new ButtonWithDelegates("Ok");

            button.Register(Notify);
            button.Click();
            Assert.IsTrue(Called);
        }
        public void Callback_GivenCallackDelegate()
        {
            Callback            callback = new Callback();
            ButtonWithDelegates button   = new ButtonWithDelegates("Ok");

            button.Register(callback.Notify);
            button.Click();
            Assert.IsTrue(callback.Called);
        }
        public void Notify_GivenLambdaExpression_Success()
        {
            ButtonWithDelegates button = new ButtonWithDelegates("Ok");
            bool called = false;

            Action notify = () => { called = true; };

            button.Register(Notify);
            button.Register(
                () => { called = true; });
            button.Click();
            Assert.IsTrue(called);
        }
        public void Notify_GivenLocalMethod_Success()
        {
            ButtonWithDelegates button = new ButtonWithDelegates("Ok");
            bool called = false;

            void Notify()
            {
                called = true;
            }

            button.Register(Notify);
            button.Click();
            Assert.IsTrue(called);
        }