public void WhenBuildOccurredIsFiredTheDelegateIsInvokedThroughISynchronisedInvoke()
		{
			DynamicMock mockSynchronizeInvoke = new DynamicMock(typeof (ISynchronizeInvoke));
			StubProjectMonitor containedMonitor = new StubProjectMonitor("test");

			SynchronizedProjectMonitor monitor = new SynchronizedProjectMonitor(
				containedMonitor,
				(ISynchronizeInvoke) mockSynchronizeInvoke.MockInstance);

			MonitorBuildOccurredEventHandler delegateToBuildOccurred = new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);
			monitor.BuildOccurred += delegateToBuildOccurred;

			mockSynchronizeInvoke.Expect("BeginInvoke", delegateToBuildOccurred, new IsTypeOf(typeof (object[])));
			containedMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(null, BuildTransition.StillFailing));

			mockSynchronizeInvoke.Verify();
		}
        public void WhenBuildOccurredIsFiredTheDelegateIsInvokedThroughISynchronisedInvoke()
        {
            DynamicMock        mockSynchronizeInvoke = new DynamicMock(typeof(ISynchronizeInvoke));
            StubProjectMonitor containedMonitor      = new StubProjectMonitor("test");

            SynchronizedProjectMonitor monitor = new SynchronizedProjectMonitor(
                containedMonitor,
                (ISynchronizeInvoke)mockSynchronizeInvoke.MockInstance);

            MonitorBuildOccurredEventHandler delegateToBuildOccurred = new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);

            monitor.BuildOccurred += delegateToBuildOccurred;

            mockSynchronizeInvoke.Expect("BeginInvoke", delegateToBuildOccurred, new IsTypeOf(typeof(object[])));
            containedMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(null, BuildTransition.StillFailing));

            mockSynchronizeInvoke.Verify();
        }
        public void WhenBuildOccurredIsFiredTheDelegateIsInvokedThroughISynchronisedInvoke()
        {
            var mockSynchronizeInvoke           = new Mock <ISynchronizeInvoke>();
            StubProjectMonitor containedMonitor = new StubProjectMonitor("test");

            SynchronizedProjectMonitor monitor = new SynchronizedProjectMonitor(
                containedMonitor,
                (ISynchronizeInvoke)mockSynchronizeInvoke.Object);

            MonitorBuildOccurredEventHandler delegateToBuildOccurred = new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);

            monitor.BuildOccurred += delegateToBuildOccurred;

            mockSynchronizeInvoke.Setup(invoke => invoke.BeginInvoke(delegateToBuildOccurred, It.IsAny <object[]>())).Verifiable();
            containedMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(null, BuildTransition.StillFailing));

            mockSynchronizeInvoke.Verify();
        }