public void CalculatesTheRottingTime()
        {
            var input   = Grid.BuildGridOne();
            var minutes = RottingOranges.HowManyMinutes(input);

            Assert.Equal(4, minutes);
        }
Exemple #2
0
        public void OrangesRottingTest()
        {
            RottingOranges obj = new RottingOranges();

            int[][] arr = new int[][] {
                new[] { 2, 1, 1 },
                new[] { 1, 1, 0 },
                new[] { 0, 1, 1 }
            };

            var x = obj.OrangesRotting(arr);//4

            arr = new int[][] {
                new[] { 0, 2 }
            };

            x = obj.OrangesRotting(arr);//0

            arr = new int[][] {
                new[] { 2, 1, 1 },
                new[] { 0, 1, 1 },
                new[] { 1, 0, 1 }
            };

            x = obj.OrangesRotting(arr);
        }
        public void IndicatesNotRottenOranges()
        {
            var input   = Grid.BuildGridTwo();
            var minutes = RottingOranges.HowManyMinutes(input);

            Assert.Equal(-1, minutes);
        }
Exemple #4
0
 public void BeforeEach()
 {
     RottingOranges = new RottingOranges();
 }