Пример #1
0
        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());
        }
Пример #2
0
        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);
        }