Exemplo n.º 1
0
        public void WhenInactiveExecueIsCalledWithNullCommand()
        {
            var mockRobot      = new Mock <IRobot>();
            var mockCalculator = new Mock <ICalculator>();
            var inactive       = new Inactive(mockRobot.Object, mockCalculator.Object);

            Assert.Throws <ArgumentException>(() => inactive.Execute(null));
        }
Exemplo n.º 2
0
        public void WhenInactiveExecueIsCalledWithNotNullCommandAndNullPositionIsNull()
        {
            var mockRobot      = new Mock <IRobot>();
            var mockCommand    = new Mock <ICommand>();
            var mockCalculator = new Mock <ICalculator>();
            var inactive       = new Inactive(mockRobot.Object, mockCalculator.Object);

            inactive.Execute(mockCommand.Object);
            mockCalculator.Verify(calc => calc.GetPositionAndState(It.IsAny <ICommand>()));
        }