public void ReturnsEmptyPointIfFirstColorNotFound()
        {
            Img = new Bitmap(10, 10);

            Point actual = ColorFinder.FindFirstColorLocation(Img, Color.Red);

            Assert.That(actual.IsEmpty);
        }
Beispiel #2
0
        public void ChangesTheFontColorToBlack()
        {
            var colorFinder = new ColorFinder();
            var img         = new Bitmap(Images.PointsSmallImage);

            var blackBefore     = colorFinder.FindFirstColorLocation(img, Color.FromArgb(0, 0, 0));
            var fontColorBefore = colorFinder.FindFirstColorLocation(img, NMZColors.Font);

            var newImage = imageFilterer.FilterImage(img);

            var blackAfter     = colorFinder.FindFirstColorLocation(img, Color.FromArgb(0, 0, 0));
            var fontColorAfter = colorFinder.FindFirstColorLocation(img, NMZColors.Font);

            img.Dispose();

            Assert.AreNotEqual(blackBefore, blackAfter);
            Assert.AreNotEqual(fontColorBefore, fontColorAfter);
        }
        public void ReturnsTheFirstPixelLocationOfTheColor()
        {
            Point expected = new Point(2516, 303);

            Img = new Bitmap(Images.PointsFullImage);

            Point actual = ColorFinder.FindFirstColorLocation(Img, NMZColors.Border);

            Assert.AreEqual(expected, actual);
        }