public void DecodeMissingEpd() { string invalidText = SampleQRCodeText.CreateQrCodeText1(false).Replace("EPD", "E_P"); QRBillValidationException err = Assert.Throws <QRBillValidationException>( () => QRBill.DecodeQrCodeText(invalidText)); TestHelper.AssertSingleError(err.Result, ValidationConstants.KeyValidDataStructure, ValidationConstants.FieldTrailer); }
public void DecodeInvalidNumber() { string invalidText = SampleQRCodeText.CreateQrCodeText1(false).Replace("3949.75", "1239d49.75"); QRBillValidationException err = Assert.Throws <QRBillValidationException>( () => QRBill.DecodeQrCodeText(invalidText)); TestHelper.AssertSingleError(err.Result, ValidationConstants.KeyValidNumber, ValidationConstants.FieldAmount); }
public void DecodeTextB1B() { Bill bill = SampleQRCodeText.CreateBillData1(); TestHelper.NormalizeSourceBill(bill); Bill bill2 = QRBill.DecodeQrCodeText(SampleQRCodeText.CreateQrCodeText1(true)); TestHelper.NormalizeDecodedBill(bill2); Assert.Equal(bill, bill2); }
private void DecodeTextB1A() { Bill bill = SampleQRCodeText.CreateBillData1(); NormalizeSourceBill(bill); Bill bill2 = QRBill.DecodeQrCodeText(SampleQRCodeText.CreateQrCodeText1(false)); NormalizeDecodedBill(bill2); Assert.Equal(bill, bill2); }
public void decodeIgnoreMinorVersion() { Bill bill = SampleQRCodeText.CreateBillData1(); TestHelper.NormalizeSourceBill(bill); string qrCodeText = SampleQRCodeText.CreateQrCodeText1(false); qrCodeText = qrCodeText.Replace("\n0200\n", "\n0201\n"); Bill bill2 = QRBill.DecodeQrCodeText(qrCodeText); TestHelper.NormalizeDecodedBill(bill2); Assert.Equal(bill, bill2); }
public void CreateText1() { Bill bill = SampleQRCodeText.CreateBillData1(); Assert.Equal(SampleQRCodeText.CreateQrCodeText1(false), QRBill.EncodeQrCodeText(bill)); }