public void splitTestOK1() { string code = "223175087923687075112234402528973166755123456781508151013321"; string[] lines = BarCodesHelpers.SplitCode(code, 1); Assert.AreEqual(lines.Length, 1); StringAssert.AreEqualIgnoringCase(lines[0], code); }
public void splitTestOK4() { string code = "223175087923687075112234402528973166755123456781508151013321"; string[] lines = BarCodesHelpers.SplitCode(code, 4); Assert.AreEqual(lines.Length, 4); StringAssert.AreEqualIgnoringCase(lines[0], "441223175087923687"); StringAssert.AreEqualIgnoringCase(lines[1], "442075112234402528"); StringAssert.AreEqualIgnoringCase(lines[2], "443973166755123456"); StringAssert.AreEqualIgnoringCase(lines[3], "444781508151013321"); }
public void splitTestOK5() { string code = "223175087923687075112234402528973166755123456781508151013321"; string[] lines = BarCodesHelpers.SplitCode(code, 5); Assert.AreEqual(lines.Length, 5); StringAssert.AreEqualIgnoringCase(lines[0], "41223175087923"); StringAssert.AreEqualIgnoringCase(lines[1], "42687075112234"); StringAssert.AreEqualIgnoringCase(lines[2], "43402528973166"); StringAssert.AreEqualIgnoringCase(lines[3], "44755123456781"); StringAssert.AreEqualIgnoringCase(lines[4], "45508151013321"); }
public void splitTestOK6() { string code = "223175087923687075112234402528973166755123456781508151013321"; string[] lines = BarCodesHelpers.SplitCode(code, 6); Assert.AreEqual(lines.Length, 6); StringAssert.AreEqualIgnoringCase(lines[0], "412231750879"); StringAssert.AreEqualIgnoringCase(lines[1], "422368707511"); StringAssert.AreEqualIgnoringCase(lines[2], "432234402528"); StringAssert.AreEqualIgnoringCase(lines[3], "449731667551"); StringAssert.AreEqualIgnoringCase(lines[4], "452345678150"); StringAssert.AreEqualIgnoringCase(lines[5], "468151013321"); }
public void splitTestErr() { string code = "87648732165498743659874326"; // not corect length for (int i = 1; i < 10; i++) { string[] lines = BarCodesHelpers.SplitCode(code, i); if (i == 1) { Assert.AreEqual(lines[0], code); } else { for (int t = 0; t < Math.Min(i, 6); t++) { Assert.IsNullOrEmpty(lines[t]); } } } }
public string[] GetBarCode128Lines(int noLines) { return(BarCodesHelpers.SplitCode(this.BarCodeValue, noLines)); }