public void BasicTest1() { int[,] board = { { 0, 0, 1, 0 }, { 0, 0, 1, 0 }, { 0, 0, 1, 0 } }; int[,] attacks = { { 3, 1 }, { 3, 2 }, { 3, 3 } }; var result = new BattleshipsCalculator(board, attacks).Results(); Assert.Equal(1, result["sunk"]); Assert.Equal(0, result["damaged"]); Assert.Equal(0, result["notTouched"]); Assert.Equal(1, result["points"]); }
public void BasicTest2() { int[,] board = { { 3, 0, 1 }, { 3, 0, 1 }, { 0, 2, 1 }, { 0, 2, 0 } }; int[,] attacks = { { 2, 1 }, { 2, 2 }, { 3, 2 }, { 3, 3 } }; var calc = new BattleshipsCalculator(board, attacks); var result = calc.Results(); Assert.Equal(1, result["sunk"]); Assert.Equal(1, result["damaged"]); Assert.Equal(1, result["notTouched"]); Assert.Equal(0.5, result["points"]); }