コード例 #1
0
        public void Construction()
        {
            stateAssignerMock_.Unassign(Arg.Any <object>()).Returns(idleControllerStateMock_);

            var unused = new Controller(stateAssignerMock_, controllerBehaviourMock_);

            stateAssignerMock_.Received(1).Unassign(Arg.Any <object>());
            idleControllerStateMock_.Received(1).OnStateSelected();
        }
コード例 #2
0
        public void Construction_OnTriggerPressed_first_time()
        {
            carrierControllerStateMock_.Identifier.Returns("Carrier");
            stateAssignerMock_.Assign(Arg.Any <object>()).Returns(carrierControllerStateMock_);

            var unused = new Controller(stateAssignerMock_, controllerBehaviourMock_);

            {
                controllerBehaviourMock_.TriggerPressed += Raise.Event <Action>();

                stateAssignerMock_.Received(1).Assign(Arg.Any <object>());
                controllerBehaviourMock_.IndicatorBehaviour.Received(1).FuncText = "Carrier";
                carrierControllerStateMock_.Received(1).OnStateSelected();
            }
        }