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); }
public void CompareWorksWithNoOptions() { var target = new BitmapComparer(); var result = target.Compare(FirstImage, SecondImage); result.Save(string.Format(OutputFormat, "CompareWorksWithNullOptions"), SecondImage.RawFormat); }
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); }
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)); }
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); }
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); }