public void SetGetPasswordTest() { // Arrange LoginInformation li = new LoginInformation(newTitle: "Random forum", newUrl: "https://somedomain.com", newEmail: "*****@*****.**", newUsername: "******", newPassword: "******"); string newPassword = "******"; // Act li.UpdatePassword(newPassword); // Assert Assert.AreEqual(newPassword, li.GetPassword()); }
public static LoginSimplified TurnIntoEditable(LoginInformation loginInformation, int zeroBasedIndexNumber) { return(new LoginSimplified() { zeroBasedIndexNumber = zeroBasedIndexNumber, IsSecure = false, Title = loginInformation.GetTitle(), URL = loginInformation.GetURL(), Email = loginInformation.GetEmail(), Username = loginInformation.GetUsername(), Password = loginInformation.GetPassword(), Notes = loginInformation.GetNotes(), Icon = loginInformation.GetIcon(), Category = loginInformation.GetCategory(), Tags = loginInformation.GetTags(), CreationTime = loginInformation.GetCreationTime().ToString("s", System.Globalization.CultureInfo.InvariantCulture), ModificationTime = loginInformation.GetModificationTime().ToString("s", System.Globalization.CultureInfo.InvariantCulture), }); }
public void ChecksumChangesTest() { // Arrange DateTimeOffset dto = DateTimeOffset.UtcNow; LoginInformation li1 = new LoginInformation(); LoginInformation li2 = new LoginInformation(newTitle: "Random forum", newUrl: "https://somedomain.com", newEmail: "*****@*****.**", newUsername: "******", newPassword: "******", dto); LoginInformation li3 = new LoginInformation(newTitle: "Random forum", newUrl: "https://somedomain.com", newEmail: "*****@*****.**", newUsername: "******", newPassword: "******", dto); // Act string checksum1 = li1.GetChecksumAsHex(); string checksum2 = li2.GetChecksumAsHex(); string checksum3 = li3.GetChecksumAsHex(); string updatedPassword = li3.GetPassword() + "A"; li3.UpdatePassword(updatedPassword); string checksum4 = li3.GetChecksumAsHex(); // Assert Assert.AreNotEqual(checksum1, checksum2); Assert.AreEqual(checksum3, checksum2); Assert.AreNotEqual(checksum3, checksum4); }