public void SetLoginInformationMFATest() { // Arrange byte[] derivedKey = new byte[16] { 111, 222, 31, 4, 15, 6, 7, 8, 9, 10, 11, 12, 13, 104, 15, 196 }; SymmetricKeyAlgorithm ska = SymmetricKeyAlgorithm.GenerateNew(SymmetricEncryptionAlgorithm.AES_CTR); LoginInformationSecret loginInformationSecret = new LoginInformationSecret(loginInformation, "does not matter", ska, derivedKey); string newMFA = "otpauth://totp/BIG_DRAGON?secret=YOUR_FIRE"; // Act bool shouldBeTrue = loginInformationSecret.SetMFA(newMFA, derivedKey); string loginInformationMFA2 = loginInformationSecret.GetMFA(derivedKey); bool shouldBeFalse = loginInformationSecret.SetMFA(newMFA, new byte[] { 1, 2, 3 }); // Assert Assert.IsTrue(shouldBeTrue); Assert.IsFalse(shouldBeFalse); Assert.IsFalse(string.IsNullOrEmpty(loginInformationMFA2)); Assert.AreEqual(newMFA, loginInformationMFA2); }