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 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); }