Exemplo n.º 1
0
        public void WhenGivenAnArrayOfAllCapsItIsExecutedProperly()
        {
            var input    = new[] { "NORTH", "SOUTH" };
            var expected = new string[] { };

            var result = DirectionReduction.Reduce(input);

            Assert.Equal(expected, result);
        }
Exemplo n.º 2
0
        public void WhenGivenAComplexArrayOneItemIsReturned()
        {
            var input    = new[] { "NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST" };
            var expected = new[] { "WEST" };

            var result = DirectionReduction.Reduce(input);

            Assert.Equal(expected, result);
        }
Exemplo n.º 3
0
        public void WhenGivenNorthTheDirectionIsNorth()
        {
            var justNorthInput  = new[] { "North" };
            var justNorthOutput = new[] { "North" };

            var result = DirectionReduction.Reduce(justNorthInput);

            Assert.Equal(justNorthOutput, result);
        }
Exemplo n.º 4
0
        public void WhenGivenNorthEastSouthWestInputIsReturned()
        {
            var input    = new[] { "North", "East", "South", "West" };
            var expected = new [] { "North", "East", "South", "West" };

            var result = DirectionReduction.Reduce(input);

            Assert.Equal(expected, result);
        }
Exemplo n.º 5
0
        public void WhenGivenEastWestAnEmptyIsReturned()
        {
            var input    = new[] { "East", "West" };
            var expected = new string[] {};

            var result = DirectionReduction.Reduce(input);

            Assert.Equal(expected, result);
        }
Exemplo n.º 6
0
        public void WhenGivenSouthNorthAnEmptyIsReturned()
        {
            var input    = new[] { "South", "North" };
            var expected = new string[] {};

            var result = DirectionReduction.Reduce(input);

            Assert.Equal(expected, result);
        }
Exemplo n.º 7
0
        public void WhenGivenTwoInputsThatDoNotCancelResultIsTheSame()
        {
            var input    = new[] { "North", "West" };
            var expected = new[] { "North", "West" };

            var result = DirectionReduction.Reduce(input);

            Assert.Equal(expected, result);
        }