Пример #1
0
        public void GivenANegativeYPosition_WhenProcessing_ThenWillAddDrone()
        {
            var handler = new DronePositionLineHandler();

            handler.Process(_contextMock.Object, "0 -1 N");

            _contextMock.Verify(x => x.AddDrone(It.IsNotNull <Drone>()), Times.Once());
        }
Пример #2
0
        public void GivenAValidConfigurationWithExtraWhitespaces_WhenProcessing_ThenWillAddDrone()
        {
            var handler = new DronePositionLineHandler();

            handler.Process(_contextMock.Object, " 1  1  N ");

            _contextMock.Verify(x => x.AddDrone(It.IsNotNull <Drone>()), Times.Once());
        }
Пример #3
0
        public void GivenAnInvalidCasingOrientation_WhenProcessing_ThenWillThrowFormatException()
        {
            var handler = new DronePositionLineHandler();

            Assert.That(() => handler.Process(_contextMock.Object, "0 0 n"), Throws.InstanceOf <FormatException>());
        }
Пример #4
0
        public void GivenANonIntegerXPosition_WhenProcessing_ThenWillThrowFormatException()
        {
            var handler = new DronePositionLineHandler();

            Assert.That(() => handler.Process(_contextMock.Object, "a 0 N"), Throws.InstanceOf <FormatException>());
        }