Beispiel #1
0
        public void TestFailureToyPlaceOperations(string[] commands, string expectedMessage)
        {
            var subject = new ToyOperations(_logger, _robotCommands, _settings);

            Assert.That(() => subject.ProcessOperations(commands)
                        , Throws.TypeOf <CommandException>().With.Message.EqualTo($"Error command:{expectedMessage}"), "Exception message does not match");
        }
Beispiel #2
0
        public void TestRobotEdgeCaseOperation(string expectedReport, string[] commands)
        {
            var subject = new ToyOperations(_logger, new RobotCommands(Mock.Of <ILogger <RobotCommands> >()), _settings);

            subject.ProcessOperations(commands);
            Assert.That(subject.GetCurrentReport(), Is.EqualTo(expectedReport), "Expected report is incorrect");
        }
Beispiel #3
0
        public void TestSuccessfulToyPlaceOperations(bool isToyPlaced, string[] commands)
        {
            var subject = new ToyOperations(_logger, _robotCommands, _settings);

            subject.ProcessOperations(commands);
            Assert.That(subject.IsToyPlaced, Is.EqualTo(isToyPlaced), "Toy is not placed");
        }