Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Add new tests for hotp and totp
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoMiguens committed Jul 17, 2019
1 parent 14623cc commit 3c2bff9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/hotp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ void main() {

test('[HOTP] Should generate and verify using a specific counter', () {
var otpValue = hotp.at(counter: 0);

expect(otpValue, '542773');
expect(hotp.verify(otp: otpValue, counter: 0), true);
});

Expand Down
1 change: 1 addition & 0 deletions test/totp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void main() {
var time = DateTime.parse('2019-01-01 00:00:00.000');
var otpValue = totp.value(date: time);

expect(otpValue, '793957');
expect(totp.verify(otp: otpValue), false);
expect(totp.verify(otp: otpValue, time: time), true);
});
Expand Down

0 comments on commit 3c2bff9

Please sign in to comment.