Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a nullreference in QRCodeGenerator (#121)
* Add reproduction * Add back Pattern methods invoked via reflection * Fix formatting
- Loading branch information
1 parent
962e942
commit a983d9e
Showing
3 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using FluentAssertions; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace KeeTrayTOTP.Tests | ||
{ | ||
[TestClass] | ||
public class QRCodeGeneratorTests | ||
{ | ||
[TestMethod] | ||
public void QRCodeGenerator_ShouldGenerateCodeWithValidKeyUrl() | ||
{ | ||
var code = "otpauth://totp/Sample%20Entry%20%232:?secret=JBSWY3DPEHPK3PXP&issuer=Sample%20Entry%20%232"; | ||
using (var generator = new QRCoder.QRCodeGenerator()) | ||
{ | ||
var act = generator.CreateQrCode(code); | ||
|
||
act.Should().NotBeNull(); | ||
act.Version.Should().Be(8); | ||
act.ModuleMatrix.Should().HaveCount(57); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters