Exemplo n.º 1
0
        public void Should_not_reconnect_on_connection_shutdown_if_it_has_been_disposed_of()
        {
            var connection = Substitute.For <IConnection>();

            connectionFactory.CreateConnection().Returns(connection);

            sut.Connect();
            sut.Dispose();

            connection.ConnectionShutdown +=
                Raise.Event <ConnectionShutdownEventHandler>(connection, new ShutdownEventArgs(ShutdownInitiator.Application, 0, ""));

            timer.DidNotReceiveWithAnyArgs().Start(TimeSpan.Zero);
        }
Exemplo n.º 2
0
        public void SUTReceivesOnStartCancelPressedEvent_IsInIncorrectState_StartTimerIsNotCalled()
        {
            //ARRANGE
            //Get system into correct state

            //First, press power button to set powerlevel
            powerButtonSubstitute.Pressed += Raise.Event();

            //Don't press timer, so isn't ready to start cooking

            //ACT
            //Press startCancelButton to act on SUT
            startCancelButtonSubstitute.Pressed += Raise.Event();

            //ASSERT
            timerSubstitute.DidNotReceiveWithAnyArgs().Start(default);