Ejemplo n.º 1
0
        public void MatrixThatIsNull_Throws()
        {
            bool[,] matrix = null;

            Action action = () =>
            {
                int someInt = CountRegionsInBoolArray.FindCountRegionsWithTrue(matrix);
            };

            action.Should().Throw <ArgumentNullException>();
        }
Ejemplo n.º 2
0
        public void WholeMatrixWith1Region()
        {
            bool[,] matrix = new bool[3, 5]
            {
                { true, true, true, true, true },
                { true, true, true, true, true },
                { true, true, true, true, true }
            };

            CountRegionsInBoolArray.FindCountRegionsWithTrue(matrix)
            .Should().Be(1);
        }
Ejemplo n.º 3
0
        public void MatrixWith1RegionWith61RegionWith1()
        {
            bool[,] matrix = new bool[3, 5]
            {
                { true, false, false, true, true },
                { false, false, false, true, true },
                { false, false, false, true, true }
            };

            CountRegionsInBoolArray.FindCountRegionsWithTrue(matrix)
            .Should().Be(2);
        }
Ejemplo n.º 4
0
        public void MatrixWithNoRegions()
        {
            bool[,] matrix = new bool[3, 3]
            {
                { false, false, false },
                { false, false, false },
                { false, false, false }
            };

            CountRegionsInBoolArray.FindCountRegionsWithTrue(matrix)
            .Should().Be(0);
        }