Beispiel #1
0
 public void ApplyFilter_InvalidArguments_ReturnsArgumentException()
 {
     // Arrange
     var sourceBitmap = Properties.Resources.unitTestPropImage1;
     // Act
     var resultBitmap = ImageFilters.ApplyFilter(sourceBitmap, -1, -1, -1, -1);
 }
        public void ValidFilter()
        {
            Color  origine   = Color.FromArgb(100, 140, 200, 60);
            Color  wanted    = Color.FromArgb(100, 70, 50, 60);
            Bitmap imageBase = getImage(origine);
            Bitmap filtred   = ImageFilters.ApplyFilter(imageBase, 1, 2, 1, 4);

            for (int with = 0; with < filtred.Width; with++)
            {
                for (int height = 0; height < filtred.Height; height++)
                {
                    Assert.AreEqual(filtred.GetPixel(with, height), wanted);
                }
            }
        }
Beispiel #3
0
 public override Bitmap Apply(Bitmap bitmap)
 {
     return(ImageFilters.ApplyFilter(new Bitmap(bitmap), 1, 10, 1, 1));
 }
        public void InvalidFilterzero()
        {
            Bitmap image = getImage(Color.FromArgb(100, 140, 200, 60));

            ImageFilters.ApplyFilter(image, 0, 0, 0, 0);
        }
        public void InvalidFilterMinusOne()
        {
            Bitmap image = getImage(Color.FromArgb(100, 140, 200, 60));

            ImageFilters.ApplyFilter(image, -1, -1, -1, -1);
        }
        public void NullExceptionOnNullImage()
        {
            Bitmap nulled = null;

            ImageFilters.ApplyFilter(nulled, 1, 1, 1, 1);
        }