Exemplo n.º 1
0
        public void RegisterTest()
        {
            //Arrange
            string       myName = "testuser";
            SecureString myPass = new SecureString();

            myPass.AppendChar('P');
            myPass.AppendChar('@');
            myPass.AppendChar('s');
            myPass.AppendChar('$');
            myPass.AppendChar('w');
            myPass.AppendChar('0');
            myPass.AppendChar('r');
            myPass.AppendChar('D');

            //Act
            var user = CryptoServices.Register(myName, myPass, new string[] { "Cute_Cat" });

            //Assert
            bool CorrectLogin = CryptoServices.CheckPassword("testuser", "P@s$w0rD");

            Assert.IsTrue(CorrectLogin);

            bool WrongUser = CryptoServices.CheckPassword("NotMomi", "P@s$w0rD");

            Assert.IsFalse(WrongUser);

            bool WrongLogin = CryptoServices.CheckPassword("testuser", "88881234");

            Assert.IsFalse(WrongLogin);
        }