コード例 #1
0
    def test_whenHandlingSaidStateThenPathfinderIsCalled(self):
        testedState = SequencerState.SendingBotToTreasureState()

        testedState.handle(self.sequencer,self.map, self.pathfinder)

        assert self.pathfinder.findPath.called
        assert self.sequencer.setState.called
コード例 #2
0
    def test_whenHandlingSaidStateThenReturnsCorrectOrientationToGiveRobot(self):
        testedState = SequencerState.SendingBotToTreasureState()

        path, signal, orientation = testedState.handle(self.sequencer,self.map, self.pathfinder)

        self.assertEqual(270, orientation)
コード例 #3
0
    def test_whenHandlingSaidStateThenReturnsCorrectNextSignalInSequence(self):
        testedState = SequencerState.SendingBotToTreasureState()

        path, signal, orientation = testedState.handle(self.sequencer,self.map, self.pathfinder)

        self.assertEqual("rotateToTreasure", signal)