Exemplo n.º 1
0
        public void UsingEventRaiserFromExtensionMethod()
        {
            IWithEvents  eventHolder = (IWithEvents)mocks.Stub(typeof(IWithEvents));
            IEventRaiser eventRaiser = eventHolder.GetEventRaiser(stub => stub.Blah += null);

            mocks.ReplayAll();

            bool called = false;

            eventHolder.Blah += delegate {
                called = true;
            };


            eventRaiser.Raise(this, EventArgs.Empty);

            mocks.VerifyAll();

            Assert.True(called);
        }