Ejemplo n.º 1
0
        public async void ShouldFindNose()
        {
            // arrange
            var first = await inpy.Get();

            var second = await inpy.Get();

            // act
            var result = _cut.Compare(first, second);

            // assert
            result.Should().Be(1);
        }
Ejemplo n.º 2
0
        public void CompareWorksWithNoOptions()
        {
            var target = new BitmapComparer();
            var result = target.Compare(FirstImage, SecondImage);

            result.Save(string.Format(OutputFormat, "CompareWorksWithNullOptions"), SecondImage.RawFormat);
        }
Ejemplo n.º 3
0
        public void CompareThrowsWhenImagesAreNotSameHeight()
        {
            var firstBitmap  = new Bitmap(10, 10);
            var secondBitmap = new Bitmap(10, 20);

            var target = new BitmapComparer(null);

            target.Compare(firstBitmap, secondBitmap);
        }
        public void CompareThrowsWhenImagesAreNotSameHeight()
        {
            var firstBitmap  = new Bitmap(10, 10);
            var secondBitmap = new Bitmap(10, 20);

            var target = new BitmapComparer(null);

            Should.Throw <ArgumentException>(() => target.Compare(firstBitmap, secondBitmap));
        }
        public void CompareWorksWithIdenticalImages(AnalyzerTypes aType, BoundingBoxModes bMode, LabelerTypes lType)
        {
            var target = new BitmapComparer(new CompareOptions
            {
                AnalyzerType    = aType,
                BoundingBoxMode = bMode,
                Labeler         = lType
            });
            var result = target.Compare(FirstImage, FirstImage);

            result.Save(string.Format(OutputFormat, $"CompareWorksWithIdenticalImages_{aType}_{bMode}_{lType}"), SecondImage.RawFormat);
        }
Ejemplo n.º 6
0
 public bool Equals(SteamAppTemplate other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(AppId == other.AppId && Name == other.Name &&
            BitmapComparer.Compare((Bitmap)Icon, (Bitmap)other.Icon));
 }
Ejemplo n.º 7
0
        public void CompareWorksWithDifferentImages(AnalyzerTypes aType, BoundingBoxModes bMode, LabelerTypes lType)
        {
            var target = new BitmapComparer(new CompareOptions
            {
                BoundingBoxColor   = Color.Red,
                BoundingBoxMode    = bMode,
                AnalyzerType       = aType,
                DetectionPadding   = 2,
                BoundingBoxPadding = 2,
                Labeler            = lType
            });
            var result = target.Compare(FirstImage, SecondImage);

            result.Save(string.Format(OutputFormat, string.Format("CompareWorksWithDifferentImages_{0}_{1}_{2}", aType, bMode, lType)), SecondImage.RawFormat);
        }
Ejemplo n.º 8
0
        public void CompareThrowsWhenSecondImageIsNull()
        {
            var target = new BitmapComparer(null);

            target.Compare(FirstImage, null);
        }
        public void CompareThrowsWhenSecondImageIsNull()
        {
            var target = new BitmapComparer(null);

            Should.Throw <ArgumentNullException>(() => target.Compare(FirstImage, null));
        }
        public void DifferentTest()
        {
            var result = BitmapComparer.Compare(Data.HammerIcon, Data.DefaultIcon);

            Assert.IsFalse(result);
        }
        public void BothNullTest()
        {
            var result = BitmapComparer.Compare(null, null);

            Assert.IsTrue(result);
        }
        public void SecondNullTest()
        {
            var result = BitmapComparer.Compare(Data.DefaultIcon, null);

            Assert.IsFalse(result);
        }
        public void FirstNullTest()
        {
            var result = BitmapComparer.Compare(null, Data.DefaultIcon);

            Assert.IsFalse(result);
        }
        public void EqualityTest()
        {
            var result = BitmapComparer.Compare(Data.DefaultIcon, Data.DefaultIcon);

            Assert.IsTrue(result);
        }