Пример #1
0
        public void Run_LoopNotRunningYet_IsRunningAfterwards()
        {
            // arrange
            IStateManager sm = this.mocks.NewMock<IStateManager>();
            ILogManager lm = this.mocks.NewMock<ILogManager>();
            Stub.On( lm ).Method( "Trace" ).WithAnyArguments();
            MainLoopManager mlm = new MainLoopManager( sm, lm );

            // act
            mlm.RunAsynchronous();

            // assert
            Assert.IsTrue( mlm.Running );
        }
Пример #2
0
        public void Run_LoopAlreadyRunning_ThrowInvalidOperationExceptioin()
        {
            // arrange
            IStateManager sm = this.mocks.NewMock<IStateManager>();
            ILogManager lm = this.mocks.NewMock<ILogManager>();
            Stub.On( lm ).Method( "Trace" ).WithAnyArguments();
            MainLoopManager mlm = new MainLoopManager( sm, lm );
            mlm.RunAsynchronous();

            // act
            mlm.RunAsynchronous();

            // assert
        }