public void TestLineEdges_Padding1() { var testset = new Pix(@"Tests\Barcode_Test01_linesedges_3.bmp"); var result_line1 = testset.GetLine(0); var result_line2 = testset.GetLine(1); var result_line3 = testset.GetLine(2); var l1s = result_line1.Take(3).ToArray(); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l1s, new byte[] { 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 byte[] { 32, 32, 32 }), "line1 end marker wrong"); var l2s = result_line2.Take(3).ToArray(); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l2s, new byte[] { 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 byte[] { 17, 17, 17 }), "line2 end marker wrong"); var l3s = result_line3.Take(3).ToArray(); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(l3s, new byte[] { 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 byte[] { 180, 0, 60 }), "line3 end marker wrong"); }
public void TestLines_Padding0() { var testset = new Pix(@"Tests\Barcode_Test01_linesevaluation.bmp"); var result_line1 = testset.GetLine(0); var result_line2 = testset.GetLine(1); var result_line3 = testset.GetLine(2); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(result_line1, new byte[] { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 })); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(result_line2, new byte[] { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 })); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(result_line3, new byte[] { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 })); }
public void TestLines_Padding0_PNG() { var testset = new Pix(@"Tests\Pocorgtfo12-53_24bit.png"); var result_line1 = testset.GetLine(0); var expected = Enumerable.Range(0, testset.Stride).Select(x => (byte)(255)).ToArray(); Assert.IsTrue(StructuralComparisons.StructuralEqualityComparer.Equals(expected, result_line1)); }