Esempio n. 1
0
        public void MainLoopManager_LogManagerNull_ThrowArgumentNullException()
        {
            // arrange
            MainLoopManager mlm;
            IStateManager sm = this.mocks.NewMock<IStateManager>();
            ILogManager lm = null;

            // act
            mlm = new MainLoopManager( sm, lm );

            // assert
        }
Esempio n. 2
0
        public void MainLoopManager_ValidParams_CreateInstance()
        {
            // arrange
            MainLoopManager mlm;
            IStateManager sm = this.mocks.NewMock<IStateManager>();
            ILogManager lm = this.mocks.NewMock<ILogManager>();
            Stub.On( lm ).Method( "Trace" ).WithAnyArguments();

            // act
            mlm = new MainLoopManager( sm, lm );

            // assert
            Assert.IsNotNull( mlm );
            Assert.IsInstanceOf<MainLoopManager>( mlm );
        }
Esempio n. 3
0
        public void MainLoopManager_StateManagerNull_ThrowArgumentNullException()
        {
            // arrange
            MainLoopManager mlm;
            IStateManager sm = null;
            ILogManager lm = this.mocks.NewMock<ILogManager>();
            Stub.On( lm ).Method( "Trace" ).WithAnyArguments();

            // act
            mlm = new MainLoopManager( sm, lm );

            // assert
        }
Esempio n. 4
0
        public void Stop_LoopNotRunning_ThrowInvalidOperationException()
        {
            // 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.Stop();

            // assert
        }
Esempio n. 5
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 );
        }
Esempio n. 6
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
        }