Esempio n. 1
0
 public void GoodLogin()
 {
     SqlUserManager sqm = new SqlUserManager();
     bool expected = true;
     sqm.AddUser("LoginTest", "password");
     bool actual = sqm.Login("LoginTest", "password");
     sqm.DeleteUserByUsername("LoginTest");
     Assert.AreEqual(expected, actual);
 }
Esempio n. 2
0
        public void AddUser()
        {
            SqlUserManager sqm = new SqlUserManager();
            int PreCount = sqm.Count();
            sqm.AddUser("testUser", "password");
            int PostCount = sqm.Count();

            Assert.AreEqual((PreCount + 1), PostCount);
        }
        public void AddInvaliduser()
        {
            SqlUserManager sqm = new SqlUserManager();
            int PreCount = sqm.Count();
            sqm.AddUser("", "password");
            int PostCount = sqm.Count();

            Assert.AreEqual(PreCount, PostCount);
        }
Esempio n. 4
0
        public void DeleteUserByUsername()
        {
            SqlUserManager sqm = new SqlUserManager();
            sqm.AddUser("deleteTest", "password");
            int PreCount = sqm.Count();
            sqm.DeleteUserByUsername("deleteTest");
            int PostCount = sqm.Count();

            Assert.AreEqual(PreCount-1, PostCount);
        }