public void SetLoginInformationCategoryTest() { // Arrange byte[] derivedKey = new byte[16] { 111, 222, 31, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 104, 15, 16 }; SymmetricKeyAlgorithm ska = SymmetricKeyAlgorithm.GenerateNew(SymmetricEncryptionAlgorithm.AES_CTR); LoginInformationSecret loginInformationSecret = new LoginInformationSecret(loginInformation, "does not matter", ska, derivedKey); string newCategory = "Finance"; // Act bool shouldBeTrue = loginInformationSecret.SetCategory(newCategory, derivedKey); string loginInformationCategory2 = loginInformationSecret.GetCategory(derivedKey); bool shouldBeFalse = loginInformationSecret.SetCategory(newCategory, new byte[] { 13, 129, 0, 99, 134, 255, 0 }); // Assert Assert.IsTrue(shouldBeTrue); Assert.IsFalse(shouldBeFalse); Assert.IsFalse(string.IsNullOrEmpty(loginInformationCategory2)); Assert.AreEqual(newCategory, loginInformationCategory2); }