Пример #1
0
        public void SafeSpots_CorrectlyCountsSafeSpotsInRow()
        {
            var sut = new Traps();

            var actual = sut.SafeSpots("..^^.");

            Assert.Equal(3, actual);
        }
Пример #2
0
        // This test runs correctly, but is very time-consuming.  And actually, the "test" is the
        // live test case to submit, not an actual test.
        //[Fact]
        public void ActualProblem()
        {
            var input = "^.^^^.^..^....^^....^^^^.^^.^...^^.^.^^.^^.^^..^.^...^.^..^.^^.^..^.....^^^.^.^^^..^^...^^^...^...^.";
            var sut   = new Traps();

            var rows = sut.Next(input, 399999, includefirstRow: true);

            var safeSpots = sut.SafeSpots(rows);
        }
Пример #3
0
        public void SafeSpots_LongerExample_IsCorrect()
        {
            var sut = new Traps();

            var rows = sut.Next(".^^.^.^^^^", 9, includefirstRow: true);

            var actual = sut.SafeSpots(rows);

            Assert.Equal(38, actual);
        }
Пример #4
0
        public void SafeSpots_CorrectlyCountsSafeSpotsInAllRows()
        {
            var sut = new Traps();

            var rows = sut.Next("..^^.", 2, includefirstRow: true);

            var actual = sut.SafeSpots(rows);

            Assert.Equal(6, actual);
        }