JAN-13 barcode doesn't automatically calculate checksum when not provided#197
JAN-13 barcode doesn't automatically calculate checksum when not provided#197mjamro wants to merge 1 commit intobarnhill:masterfrom
Conversation
| /// Written by: Brad Barnhill | ||
| /// </summary> | ||
| class JAN13 : BarcodeCommon, IBarcode | ||
| internal class JAN13 : BarcodeCommon, IBarcode |
There was a problem hiding this comment.
if we mark this symbology as internal shouldnt we mark the others as well?
There was a problem hiding this comment.
if we mark this symbology as internal shouldnt we mark the others as well?
There’s no reason to mark a class in the global scope internal. That is the default visibility. I’d argue to remove internal here instead of adding it.
| public JAN13(string input) | ||
| { | ||
| RawData = input; | ||
| _ean13 = new EAN13(input); |
There was a problem hiding this comment.
instead of initing an EAN13 here wouldnt it be better to expose the check digit method there and call the check digit here in the constructor OR make a copy of the CheckDigit() method in JAN so we get proper error codes here and just calculate it here. This way the init doesnt have to happen which runs the encoding and such till after the data validation is done?
JAN-13 barcode doesn't automatically calculate checksum when not provided. This differs from the EAN-13 behaviour which calculates it correctly.
The provided unit tests reproduces that case.