public void GetTumourPositionFromMaskTestNoWhiteColour() { byte[,] testValue = new byte[, ] { { 253, 102, 133 }, { 137, 0, 0 }, { 90, 0, 65 } }; UByteArrayAsImage image = new UByteArrayAsImage(testValue); Assert.Throws <ArgumentException>(() => GetTumourPositionFromMask(image)); }
public void UBytePixelArrayGetSetTest() { byte[,] pixelArray = new byte[, ] { { 2, 50 }, { 0, 10 } }; UByteArrayAsImage image = new UByteArrayAsImage(pixelArray); image.PixelArray = pixelArray; CollectionAssert.AreEqual(pixelArray, image.PixelArray); }
public void GetTumourPositionFromMaskTest() { Rectangle RealValue = new Rectangle(1, 1, 1, 1); byte[,] testValue = new byte[, ] { { 0, 0, 0 }, { 0, 255, 0 }, { 0, 0, 0 } }; UByteArrayAsImage image = new UByteArrayAsImage(testValue); Rectangle rectangleTestValue = GetTumourPositionFromMask(image); Assert.AreEqual(RealValue, rectangleTestValue); }