public void ZoneIsExtracted()
        {
            var original = Utils.Load("Zoning.OverallStatus_NoZones"); //article without cut zone
            var zoned = Utils.Load("Zoning.OverallStatus_Zoned"); //article with cut zone
           
            var extractor = new ZoneExtractor();

            var actual = extractor.ExtractZone(original, zoned);
            var expected = Utils.Load("Zoning.OverallStatus_ZoneCut"); //just the donkey

            var comparer = new ImageComparer();
            Assert.IsTrue(comparer.IsEqual(expected, actual));
        }
        public void ZoneExtractedIsWrong()
        {
            var original = Utils.Load("Zoning.OverallStatus_NoZones"); //article without cut zone
            var zoned = Utils.Load("Zoning.OverallStatus_Zoned"); //article with cut zone

            var extractor = new ZoneExtractor();

            var actual = extractor.ExtractZone(original, zoned);
            var expected = Utils.Load("Zoning.OverallStatus_ZoneCutIsCat"); //its the cat

            var comparer = new ImageComparer();
            Assert.IsFalse(comparer.IsEqual(expected, actual));
        }
예제 #3
0
 /// <summary>
 /// Determines whether or not a zone looks as expected.
 /// </summary>
 /// <param name="expected"></param>
 /// <param name="actual"></param>
 /// <param name="actualWithZone"></param>
 /// <returns></returns>
 public bool ZonedEqual(Stream expected, Stream actual, Stream actualWithZone)
 {
     var extractor = new ZoneExtractor();
     var extracted = extractor.ExtractZone(actual, actualWithZone);
     return IsEqual(expected, extracted);
 }