public void GenerateOk() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); var c = b.Generate(1); Assert.IsNotNull(c); }
public void Get() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); b[13, 11] = true; Assert.IsTrue(b.Get(new IntCoordinate(11, 13))); }
public void Constructor() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); Assert.AreEqual(width, b.Width); Assert.AreEqual(height, b.Height); }
public void IsNotInside() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); Assert.IsFalse(b.IsInside(new IntCoordinate(111, 133))); Assert.IsFalse(b.IsInside(new IntCoordinate(width, height))); Assert.IsFalse(b.IsInside(new IntCoordinate(-1, -1))); }
public void IsInside() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); Assert.IsTrue(b.IsInside(new IntCoordinate(11, 13))); Assert.IsTrue(b.IsInside(new IntCoordinate(width - 1, height - 1))); Assert.IsTrue(b.IsInside(new IntCoordinate(0, 0))); }
public void Set() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); var c = new IntCoordinate(11, 13); b.Set(c, true); Assert.IsTrue(b.Get(c)); }
public void This() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); Assert.IsFalse(b[11, 13]); b[11, 13] = true; Assert.IsTrue(b[11, 13]); b[11, 13] = false; Assert.IsFalse(b[11, 13]); }
public void GenerateFail() { const int width = 43; const int height = 29; var b = new BoolMatrix(width, height); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { b[y, x] = true; } } var c = b.Generate(1); Assert.IsNull(c); }