示例#1
0
 public void TestCanPlace()
 {
     Grid g = new Grid(9,0);
     g.Place(3,1,1);
     for (int i = 0; i < 9; i++)
     {
         Assert.AreEqual(false, g.CanPlace(3, i, 1)); //test row
         Assert.AreEqual(false, g.CanPlace(3, 1, i)); //test col
     }
     for (int i = 0; i < 3; i++)
         for (int j = 0; j < 3; j++ )
             Assert.AreEqual(false, g.CanPlace(3, i, j)); //test row
     Assert.AreEqual(true, g.CanPlace(3, 5, 5)); //test col
 }