public void Equals()
        {
            var list1 = new CoordinateList<int>();
              var list2 = new CoordinateList<int>();
              var c = new Coordinate<int>(13, 14);

              list1.Add(c);
              Assert.IsFalse(list1.Equals(list2));

              list2.Add(c);
              Assert.IsTrue(list1.Equals(list2));
        }
Beispiel #2
0
        public void equals_false(int[] coords1, int[] coords2)
        {
            CoordinateList cg1 = new CoordinateList(coords1);
            CoordinateList cg2 = new CoordinateList(coords2);

            Assert.False(cg1.Equals(cg2));
        }
        public void get_coordinates_where_values_are_possible_test()
        {
            SudokuGrid grid = new SudokuGrid("000000000|000000000|000000000||000000000|000000000|000000000||000000000|000000000|000000000");

            grid._grid_cells[0, 0]._possible_values = new List <int> {
                1, 2, 3, 4, 5, 6
            };
            grid._grid_cells[0, 1]._possible_values = new List <int> {
                2
            };
            grid._grid_cells[0, 2]._possible_values = new List <int> {
                2, 5
            };
            grid._grid_cells[1, 1]._possible_values = new List <int> {
                3, 9
            };
            grid._grid_cells[2, 2]._possible_values = new List <int> {
                2, 3, 9
            };

            List <int> search_vals = new List <int> {
                2
            };
            CoordinateList search_coords = new CoordinateList(new int[] { 0, 0, 0, 1, 1, 1, 0, 2, 7, 7 });

            CoordinateList coords_found = SudokuGrid.get_coordinates_where_values_are_possible(grid._grid_cells, search_vals, search_coords);

            Assert.True(coords_found.Equals(new CoordinateList(new int[] { 0, 0, 0, 1, 0, 2 })));
            Assert.False(coords_found.Equals(new CoordinateList(new int[] { 0, 0 })));

            search_vals = new List <int> {
                2, 5
            };

            coords_found = SudokuGrid.get_coordinates_where_values_are_possible(grid._grid_cells, search_vals, search_coords);

            Assert.True(coords_found.Equals(new CoordinateList(new int[] { 0, 0, 0, 2 })), "Find pair of values");
        }
        public void get_all_coordinates_for_block_true(int x, int y, CoordinateList expected_coords)
        {
            CoordinateList coords = SudokuGrid.get_all_coordinates_for_block(x, y);

            Assert.True(coords.Equals(expected_coords), coords.ToString());
        }
        public void get_all_coordinates_for_row_true(int x, int y, CoordinateList expected_coords)
        {
            CoordinateList coords = SudokuGrid.get_all_coordinates_for_row(x, y);

            Assert.True(coords.Equals(expected_coords));
        }
        public void get_other_coordinates_for_column_true(int x, int y, CoordinateList expected_coords)
        {
            CoordinateList coords = SudokuGrid.get_other_coordinates_for_column(x, y);

            Assert.True(coords.Equals(expected_coords));
        }