示例#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));
    }