|
@@ -6,8 +6,17 @@ void main() {
|
|
final code1 = Code.fromRawData(
|
|
final code1 = Code.fromRawData(
|
|
"otpauth://totp/example%20finance%3Aee%40ff.gg?secret=ASKZNWOU6SVYAMVS",
|
|
"otpauth://totp/example%20finance%3Aee%40ff.gg?secret=ASKZNWOU6SVYAMVS",
|
|
);
|
|
);
|
|
- expect(code1.issuer, "example finance");
|
|
|
|
- expect(code1.account, "ee@ff.gg");
|
|
|
|
|
|
+ expect(code1.issuer, "example finance", reason: "issuerMismatch");
|
|
|
|
+ expect(code1.account, "ee@ff.gg", reason: "accountMismatch");
|
|
expect(code1.secret, "ASKZNWOU6SVYAMVS");
|
|
expect(code1.secret, "ASKZNWOU6SVYAMVS");
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ test("parseDocumentedFormat", () {
|
|
|
|
+ final code = Code.fromRawData(
|
|
|
|
+ "otpauth://totp/testdata@ente.io?secret=ASKZNWOU6SVYAMVS&issuer=GitHub",
|
|
|
|
+ );
|
|
|
|
+ expect(code.issuer, "GitHub", reason: "issuerMismatch");
|
|
|
|
+ expect(code.account, "testdata@ente.io", reason: "accountMismatch");
|
|
|
|
+ expect(code.secret, "ASKZNWOU6SVYAMVS");
|
|
|
|
+ });
|
|
}
|
|
}
|