public void GetLoginInformationTagsTest()
        {
            // Arrange
            byte[] derivedKey = new byte[16] {
                111, 222, 31, 47, 75, 168, 78, 83, 91, 110, 221, 18, 213, 104, 15, 16
            };
            byte[] initialCounter = new byte[] { 0xa0, 0xb1, 0xcb, 0xfd, 0xaa, 0xc5, 0xd5, 0xb5, 0x58, 0x59, 0x15, 0xfb, 0x33, 0xfd, 0xfe, 0xff };

            SettingsAES_CTR settingsAES_CTR = new SettingsAES_CTR(initialCounter);

            SymmetricKeyAlgorithm skaAES_CTR = new SymmetricKeyAlgorithm(SymmetricEncryptionAlgorithm.AES_CTR, 256, settingsAES_CTR);

            LoginInformation loginInformationModified = loginInformation.ShallowCopy();

            loginInformationModified.UpdateTags("personal");

            LoginInformationSecret loginInformationSecret = new LoginInformationSecret(loginInformationModified, "does not matter", skaAES_CTR, derivedKey);

            // Act
            string loginInformationTags = loginInformationSecret.GetTags(derivedKey);

            // Assert
            Assert.IsFalse(string.IsNullOrEmpty(loginInformationTags));
            Assert.AreEqual(loginInformationModified.tags, loginInformationTags);
        }
Пример #2
0
        public void SetGetTagsTest()
        {
            // Arrange
            LoginInformation li = new LoginInformation(newTitle: "Random forum", newUrl: "https://somedomain.com", newEmail: "*****@*****.**", newUsername: "******", newPassword: "******",
                                                       newNotes: "some boring notes for someone", newMFA: "otpauth://totp/DRAGON?secret=SECRET", newIcon: new byte[] { 1, 2, 3, 45 }, newCategory: "Forums", newTags: "Hobbies");
            string newTags = "Leisure";

            // Act
            li.UpdateTags(newTags);

            // Assert
            Assert.AreEqual(newTags, li.GetTags());
        }