public void ConvertToGray_When_Passed_An_Image_Returns_An_Image_Where_The_First_And_Last_Pixels_Have_The_Calculated_Grey_Value_For_The_Red_Blue_And_Green_Components() { //Arrange Bitmap originalImage = new Bitmap(@"C:\Users\Public\test_224_299_Image.bmp"); Color oldImageFirstPixel = originalImage.GetPixel(0, 0); int grayOldImageFirstPixel = (byte)(.299 * oldImageFirstPixel.R + .587 * oldImageFirstPixel.G + .114 * oldImageFirstPixel.B); Color oldImageLastPixel = originalImage.GetPixel(298, 223); int grayoldImageLastPixel = (byte)(.299 * oldImageLastPixel.R + .587 * oldImageLastPixel.G + .114 * oldImageLastPixel.B); //Act Processing.ConvertToGrey(originalImage); Color newImageFirstPixel = originalImage.GetPixel(0, 0); Color newImageLastPixel = originalImage.GetPixel(298, 223); Color newImageTopLeftPixel = originalImage.GetPixel(0, 0); int newImageWidth = originalImage.Width; int newImageHeight = originalImage.Height; //Assert //First Pixel is greyed Assert.AreEqual(grayOldImageFirstPixel, newImageFirstPixel.R); Assert.AreEqual(grayOldImageFirstPixel, newImageFirstPixel.G); Assert.AreEqual(grayOldImageFirstPixel, newImageFirstPixel.B); //Last Pixel is greyed Assert.AreEqual(grayoldImageLastPixel, newImageLastPixel.R); Assert.AreEqual(grayoldImageLastPixel, newImageLastPixel.G); Assert.AreEqual(grayoldImageLastPixel, newImageLastPixel.B); }