Exemple #1
0
        public void TestGetUserType(string login, string password, string expected)
        {
            SqlLogin sql = new SqlLogin();

            if (expected == "Exception")
            {
                Assert.Throws <ArgumentException>(() => sql.GetUserType(login, password));
                return;
            }
            Assert.Equal(expected, sql.GetUserType(login, password).Permission);
        }
Exemple #2
0
        public void TestChangePassword()
        {
            SqlLogin sql         = new SqlLogin();
            string   login       = "******";
            string   email       = "*****@*****.**";
            string   newPassword = "******";

            sql.ChangePassword(login, email, newPassword);
            IEnumerable <ClassUser> query =
                from elem in sql.ListUser
                where elem.Login == login && elem.Email == email
                select elem;

            Assert.Equal(newPassword, query.First().Password);
        }
Exemple #3
0
        public void TestCheckLoginAndEmail(string login, string email, bool expected)
        {
            SqlLogin sql = new SqlLogin();

            Assert.Equal(expected, sql.CheckLoginAndEmail(login, email));
        }
Exemple #4
0
        public void TsetCheckLoginDetails(string login, string password, bool expected)
        {
            SqlLogin sql = new SqlLogin();

            Assert.Equal(expected, sql.CheckLoginDetails(login, password));
        }