Skip to content

Commit

Permalink
add unit tests for IATA2of5
Browse files Browse the repository at this point in the history
  • Loading branch information
barnhill committed Apr 27, 2024
1 parent e6e0f99 commit 5fab830
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions BarcodeStandardTests/Symbologies/IATA2of5Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BarcodeStandard;

namespace BarcodeStandardTests.Symbologies
{
[TestClass]
public class IATA2of5Tests
{
private readonly Barcode _barcode = new()
{
EncodedType = Type.IATA2of5,
};

[DataTestMethod]
[DataRow("0380003562164928", "1010101011101110101110111010101011101010111010101011101110101010111011101010101110111010111011101010101110101110101010111011101010101110101011101110101010111010111011101010101011101011101011101011101010111010101110111010101110101010101110111001101")]
[DataRow("12345678901234567", "1010111010101011101011101010111011101110101010101011101011101110101110101010111011101010101010111011101110101011101010111010111010101011101110101110101010111010111010101110111011101010101010111010111011101011101010101110111010101110101110101001101")]
[DataRow("19279472947891274", "1010111010101011101011101011101010111010101110101010111011101011101011101010101110101110101010111011101011101010111010111010111010101011101011101010101110111011101010111010101110101110101110101010111010111010101110101010111011101110101011101001101")]
public void EncodeBarcode(string data, string expected)
{
_barcode.Encode(data);
Assert.AreEqual(expected, _barcode.EncodedValue, $"{_barcode.EncodedType}");
}
}
}

0 comments on commit 5fab830

Please sign in to comment.