public void RegionConstructorTest() { int width = 0; // TODO: Initialize to an appropriate value int height = 0; // TODO: Initialize to an appropriate value PRegion target = new PRegion(width, height); Assert.AreEqual(target.Pixels.Length, (width + 1) * (height + 1)); }
public void sampleTest() { int width = 4; // TODO: Initialize to an appropriate value int height = 4; // TODO: Initialize to an appropriate value PRegion target = new PRegion(width, height); // TODO: Initialize to an appropriate value Color v = new RColor(1,10,100,200).toColor(); // TODO: Initialize to an appropriate value int c = 0; // TODO: Initialize to an appropriate value int r = 0; // TODO: Initialize to an appropriate value target.sample(v, c, r); Assert.AreEqual(target.Pixels[c, r].toColor(), v); }
public void PixelsTest() { int width = 0; // TODO: Initialize to an appropriate value int height = 0; // TODO: Initialize to an appropriate value PRegion target = new PRegion(width, height); // TODO: Initialize to an appropriate value RColor[,] expected = null; // TODO: Initialize to an appropriate value RColor[,] actual; target.Pixels = expected; actual = target.Pixels; Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void sampleTest1() { int width = 3; // TODO: Initialize to an appropriate value int height = 3; // TODO: Initialize to an appropriate value PRegion target = new PRegion(width, height); // TODO: Initialize to an appropriate value RColor v = new RColor(128,25,4,10); // TODO: Initialize to an appropriate value int c = 0; // TODO: Initialize to an appropriate value int r = 0; // TODO: Initialize to an appropriate value target.sample(v, c, r); Assert.AreEqual(target.sample(c, r), v); }
public void sampleTest2() { int width = 3; // TODO: Initialize to an appropriate value int height = 3; // TODO: Initialize to an appropriate value PRegion target = new PRegion(width, height); // TODO: Initialize to an appropriate value int c = 0; // TODO: Initialize to an appropriate value int r = 0; // TODO: Initialize to an appropriate value RColor expected = new RColor(5,10,15,20); // TODO: Initialize to an appropriate value target.sample(expected, c, r); RColor actual; actual = target.sample(c, r); Assert.AreEqual(expected, actual); }