Esempio n. 1
0
        public void Test_Map_Throws(string input)
        {
            //given
            var directionMapper = new DirectionLiteralsMapper();
            var mapper          = new MoveCommandToCoordinatesMapper(directionMapper);

            //when
            //then
            var ex = Assert.Throws <FormatException>(() => mapper.Map(input));

            Assert.That(ex.Message, Is.EqualTo("Missing move command"));
        }
Esempio n. 2
0
        public void TestMap_CorrectInput_MappingIntoCoordinates(string input, string expected)
        {
            //given
            var directionMapper = new DirectionLiteralsMapper();
            var mapper          = new MoveCommandToCoordinatesMapper(directionMapper);

            //when
            var resut = mapper.Map(input);

            //then
            Assert.That(string.Join(',', resut.Select(r => $"({r.X};{r.Y})")), Is.EqualTo(expected));
        }