예제 #1
0
        public void TestIntLineEdges_Padding3()
        {
            var testset      = new Pix(@"Tests\Barcode_Test01_linesedges_100_101.bmp");
            var result_line1 = testset.GetIntLine(0);
            var result_line2 = testset.GetIntLine(1);
            var result_line3 = testset.GetIntLine(2);

            var l1s = result_line1.Take(3).ToArray();

            Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l1s, new int[] { 104, 104, 104 }), "line1 start marker wrong");

            var l1e = result_line1.Skip(Math.Max(0, result_line1.Count() - 3)).ToArray();

            Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l1e, new int[] { 32, 32, 32 }), "line1 end marker wrong");

            var l2s = result_line2.Take(3).ToArray();

            Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l2s, new int[] { 108, 108, 108 }), "line2 start marker wrong");

            var l2e = result_line2.Skip(Math.Max(0, result_line2.Count() - 3)).ToArray();

            Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l2e, new int[] { 17, 17, 17 }), "line2 end marker wrong");

            var l3s = result_line3.Take(3).ToArray();

            Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l3s, new int[] { 60, 0, 180 }), "line3 start marker wrong");

            var l3e = result_line3.Skip(Math.Max(0, result_line3.Count() - 3)).ToArray();

            Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l3e, new int[] { 180, 0, 60 }), "line3 end marker wrong");
        }