public void SafeSpots_CorrectlyCountsSafeSpotsInRow() { var sut = new Traps(); var actual = sut.SafeSpots("..^^."); Assert.Equal(3, actual); }
// 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); }
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); }
public void SafeSpots_CorrectlyCountsSafeSpotsInAllRows() { var sut = new Traps(); var rows = sut.Next("..^^.", 2, includefirstRow: true); var actual = sut.SafeSpots(rows); Assert.Equal(6, actual); }