Ejemplo n.º 1
0
        public void StartAndStopDoesNothing()
        {
            var extension  = new IntegrationRequestThrottleExtension();
            var serverMock = this.mocks.Create <ICruiseServer>(MockBehavior.Strict).Object;
            var config     = new ExtensionConfiguration();

            Mock.Get(serverMock).SetupAdd(_serverMock => _serverMock.IntegrationCompleted += It.IsAny <EventHandler <IntegrationCompletedEventArgs> >()).Verifiable();
            Mock.Get(serverMock).SetupAdd(_serverMock => _serverMock.IntegrationStarted   += It.IsAny <EventHandler <IntegrationStartedEventArgs> >()).Verifiable();

            extension.Initialise(serverMock, config);
            extension.Start();
            extension.Stop();

            mocks.VerifyAll();
        }
        public void StartAndStopDoesNothing()
        {
            var extension  = new IntegrationRequestThrottleExtension();
            var serverMock = this.mocks.StrictMock <ICruiseServer>();
            var config     = new ExtensionConfiguration();

            Expect.Call(() => serverMock.IntegrationCompleted += null).IgnoreArguments();
            Expect.Call(() => serverMock.IntegrationStarted   += null).IgnoreArguments();

            this.mocks.ReplayAll();
            extension.Initialise(serverMock, config);
            extension.Start();
            extension.Stop();

            this.mocks.VerifyAll();
        }