Skip to content

Commit

Permalink
Updated SwissQRCode test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
codebude committed Apr 20, 2024
1 parent 31b6875 commit 17059c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion QRCoder/PayloadGenerator.cs
Expand Up @@ -1140,7 +1140,7 @@ public override string ToString()
//AddInf "logical" element
SwissQrCodePayload += (!string.IsNullOrEmpty(additionalInformation.UnstructureMessage) ? additionalInformation.UnstructureMessage : string.Empty) + br; //Ustrd
SwissQrCodePayload += additionalInformation.Trailer + br; //Trailer
// Bugfix from #399 If BillInformation is empty, insert no linebreak
// Bugfix PR #399 If BillInformation is empty, insert no linebreak
SwissQrCodePayload += (!string.IsNullOrEmpty(additionalInformation.BillInformation) ? additionalInformation.BillInformation + br : string.Empty); //StrdBkgInf

//AltPmtInf "logical" element
Expand Down
4 changes: 2 additions & 2 deletions QRCoderTests/PayloadGeneratorTests.cs
Expand Up @@ -2509,7 +2509,7 @@ public void swissqrcode_generator_should_generate_swisscode_simple()

generator
.ToString()
.ShouldBe("SPC\r\n0200\r\n1\r\nCH2430043000000789012\r\nS\r\nJohn Doe\r\nParlamentsgebäude\r\n1\r\n3003\r\nBern\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nEUR\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nQRR\r\n990005000000000320071012303\r\n\r\nEPD\r\n");
.ShouldBe("SPC\r\n0200\r\n1\r\nCH2430043000000789012\r\nS\r\nJohn Doe\r\nParlamentsgebäude\r\n1\r\n3003\r\nBern\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nEUR\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nQRR\r\n990005000000000320071012303\r\n\r\nEPD");
}

[Fact]
Expand All @@ -2528,7 +2528,7 @@ public void swissqrcode_generator_should_generate_swisscode_full()

generator
.ToString()
.ShouldBe("SPC\r\n0200\r\n1\r\nCH2430043000000789012\r\nS\r\nJohn Doe\r\nParlamentsgebäude\r\n1\r\n3003\r\nBern\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n100.25\r\nCHF\r\nS\r\nJohn Doe\r\nParlamentsgebäude\r\n1\r\n3003\r\nBern\r\nCH\r\nQRR\r\n990005000000000320071012303\r\nThis is my unstructured message.\r\nEPDSome bill information here...");
.ShouldBe("SPC\r\n0200\r\n1\r\nCH2430043000000789012\r\nS\r\nJohn Doe\r\nParlamentsgebäude\r\n1\r\n3003\r\nBern\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n100.25\r\nCHF\r\nS\r\nJohn Doe\r\nParlamentsgebäude\r\n1\r\n3003\r\nBern\r\nCH\r\nQRR\r\n990005000000000320071012303\r\nThis is my unstructured message.\r\nEPD\r\nSome bill information here...");
}


Expand Down

0 comments on commit 17059c7

Please sign in to comment.