예제 #1
0
    public void No_rectangles()
    {
        var strings = new[]
        {
            " "
        };

        Assert.Equal(0, Rectangles.Count(strings));
    }
예제 #2
0
    public void Number_1x1_square_is_counted()
    {
        var strings = new[]
        {
            "++",
            "++"
        };

        Assert.Equal(1, Rectangles.Count(strings));
    }
예제 #3
0
    public void Rectangle_of_height_1_is_counted()
    {
        var strings = new[]
        {
            "+--+",
            "+--+"
        };

        Assert.Equal(1, Rectangles.Count(strings));
    }
예제 #4
0
    public void One_rectangle()
    {
        var strings = new[]
        {
            "+-+",
            "| |",
            "+-+"
        };

        Assert.Equal(1, Rectangles.Count(strings));
    }
예제 #5
0
    public void Rectangle_of_width_1_is_counted()
    {
        var strings = new[]
        {
            "++",
            "||",
            "++"
        };

        Assert.Equal(1, Rectangles.Count(strings));
    }
예제 #6
0
    public void One_rectangle()
    {
        var input = new[]
        {
            "+-+",
            "| |",
            "+-+"
        };

        Assert.That(Rectangles.Count(input), Is.EqualTo(1));
    }
예제 #7
0
    public void One_rectangle()
    {
        var input = new[]
        {
            "+-+",
            "| |",
            "+-+"
        };

        Assert.Equal(1, Rectangles.Count(input));
    }
예제 #8
0
    public void Two_rectangles_without_shared_parts()
    {
        var strings = new[]
        {
            "  +-+",
            "  | |",
            "+-+-+",
            "| |  ",
            "+-+  "
        };

        Assert.Equal(2, Rectangles.Count(strings));
    }
예제 #9
0
    public void Corner_is_required_for_a_rectangle_to_be_complete()
    {
        var strings = new[]
        {
            "+------+----+",
            "|      |    |",
            "+------+    |",
            "|   |       |",
            "+---+-------+"
        };

        Assert.Equal(2, Rectangles.Count(strings));
    }
예제 #10
0
    public void Rectangles_can_be_of_different_sizes()
    {
        var strings = new[]
        {
            "+------+----+",
            "|      |    |",
            "+---+--+    |",
            "|   |       |",
            "+---+-------+"
        };

        Assert.Equal(3, Rectangles.Count(strings));
    }
예제 #11
0
    public void Only_complete_rectangles_are_counted()
    {
        var strings = new[]
        {
            "  +-+",
            "    |",
            "+-+-+",
            "| | -",
            "+-+-+"
        };

        Assert.Equal(1, Rectangles.Count(strings));
    }
예제 #12
0
    public void Five_rectangles_with_shared_parts()
    {
        var strings = new[]
        {
            "  +-+",
            "  | |",
            "+-+-+",
            "| | |",
            "+-+-+"
        };

        Assert.Equal(5, Rectangles.Count(strings));
    }
예제 #13
0
    public void Rectangles_can_be_of_different_sizes()
    {
        var input = new[]
        {
            "+------+----+",
            "|      |    |",
            "+---+--+    |",
            "|   |       |",
            "+---+-------+"
        };

        Assert.That(Rectangles.Count(input), Is.EqualTo(3));
    }
예제 #14
0
    public void Only_complete_rectangles_are_counted()
    {
        var input = new[]
        {
            "  +-+",
            "    |",
            "+-+-+",
            "| | -",
            "+-+-+"
        };

        Assert.That(Rectangles.Count(input), Is.EqualTo(1));
    }
예제 #15
0
    public void Corner_is_required_for_a_rectangle_to_be_complete()
    {
        var input = new[]
        {
            "+------+----+",
            "|      |    |",
            "+------+    |",
            "|   |       |",
            "+---+-------+"
        };

        Assert.That(Rectangles.Count(input), Is.EqualTo(2));
    }
예제 #16
0
    public void Five_rectangles_with_shared_parts()
    {
        var input = new[]
        {
            "  +-+",
            "  | |",
            "+-+-+",
            "| | |",
            "+-+-+"
        };

        Assert.That(Rectangles.Count(input), Is.EqualTo(5));
    }
예제 #17
0
    public void Large_input_with_many_rectangles()
    {
        var input = new[]
        {
            "+---+--+----+",
            "|   +--+----+",
            "+---+--+    |",
            "|   +--+----+",
            "+---+--+--+-+",
            "+---+--+--+-+",
            "+------+  | |",
            "          +-+"
        };

        Assert.That(Rectangles.Count(input), Is.EqualTo(60));
    }
예제 #18
0
    public void Large_input_with_many_rectangles()
    {
        var strings = new[]
        {
            "+---+--+----+",
            "|   +--+----+",
            "+---+--+    |",
            "|   +--+----+",
            "+---+--+--+-+",
            "+---+--+--+-+",
            "+------+  | |",
            "          +-+"
        };

        Assert.Equal(60, Rectangles.Count(strings));
    }
예제 #19
0
    public void No_rectangles()
    {
        var input = new[] { " " };

        Assert.Equal(0, Rectangles.Count(input));
    }
예제 #20
0
    public void No_rows()
    {
        var input = new string[0];

        Assert.That(Rectangles.Count(input), Is.EqualTo(0));
    }
예제 #21
0
    public void No_rows()
    {
        var input = new string[0];

        Assert.Equal(0, Rectangles.Count(input));
    }
예제 #22
0
    public void No_rectangles()
    {
        var input = new[] { " " };

        Assert.That(Rectangles.Count(input), Is.EqualTo(0));
    }
예제 #23
0
    public void No_rows()
    {
        var strings = Array.Empty <string>();

        Assert.Equal(0, Rectangles.Count(strings));
    }
예제 #24
0
    public void No_rows()
    {
        var strings = new string[0];

        Assert.Equal(0, Rectangles.Count(strings));
    }