public void GetAllExactCovers_Returns_Correct_Solution_For_Test_Matrix_2() { // arrange var m = new AlgorithmXMatrix(4); m.AddRows(new[] { new[] { 0, 1, 2 }, new[] { 0, 2 }, new[] { 1 }, new[] { 3 } }); // act var solutions = m.GetAllExactCovers(); // assert AssertSoolutionsAreEqual( new[] { new[] { new[] { 1 }, new[] { 0, 2 }, new[] { 3 } }, new[] { new[] { 0, 1, 2 }, new[] { 3 } } }, solutions); }
public void GetAllExactCovers_Returns_Correct_Solution_For_Test_Matrix_1_With_Additional_Empty_Rows() { // arrange var m = new AlgorithmXMatrix(7); m.AddRows(new[] { new int[0], new[] { 2, 4, 5 }, new[] { 0, 3, 6 }, new[] { 1, 2, 5 }, new[] { 0, 3 }, new[] { 1, 6 }, new[] { 3, 4, 6 } }); // act var solutions = m.GetAllExactCovers(); // assert AssertSoolutionsAreEqual( new[] { new[] { new[] { 2, 4, 5 }, new[] { 0, 3 }, new[] { 1, 6 } } }, solutions); }
public void ArgumentException_Is_Thrown_If_Columns_Are_Not_Ordered() { // arrange var m = new AlgorithmXMatrix(4); // act m.AddRows(new[] { new [] { 3, 2 }, }); // assert Assert.Fail(); }
public void GetAllExactCovers_Returns_No_Solutions_For_Test_Matrix_3() { // arrange var m = new AlgorithmXMatrix(4); m.AddRows(new[] { new[] { 0, 1 }, new[] { 0, 2 }, new[] { 1, 2 }, }); // act var solutions = m.GetAllExactCovers(); // assert Assert.AreEqual(0, solutions.Count()); }