public void TestAddUser()
        {
            User temporaryUser = users.RegisterUser(
                "Unit Tester", "*****@*****.**", "http://unit.test/image.jpg", "-#un1tT3st#");

            Assert.IsNotNull(temporaryUser);

            users.DeleteUser(temporaryUser.Id);
        }
Beispiel #2
0
        public void DeleteUser_ShouldWork(int userId)
        {
            User newUser = new User {
                UserId = userId
            };
            bool isExist = UserControl.IsUserExist(userList, newUser);

            Assert.True(!isExist);
            Assert.Throws <ArgumentException>(param, () => UserControl.DeleteUser(userList, newUser));
        }
        public void DeleteUser_ShouldWork(int userId)
        {
            User newUser = new User {
                UserId = userId
            };

            userControl.DeleteUser(newUser);
            var actual = userControl.RetrieveUserList(); //retrieve list

            Assert.DoesNotContain(newUser, actual);
        }
Beispiel #4
0
        public static void Setup(TestContext testContext)
        {
            //Clean up possible junk in DB to set up the test
            users.DeleteUser(users.GetUserNullable(author)?.Id);
            users.DeleteUser(users.GetUserNullable(reservingUser)?.Id);
            users.DeleteUser(users.GetUserNullable(thirdUser)?.Id);

            users.RegisterUser("Reserve Unit Tester", author, "http://test.com/image.jpg", pass);
            users.RegisterUser("Reserve Unit Tester", reservingUser, "http://test.com/image.jpg", pass);
            users.RegisterUser("Reserve Unit Tester", thirdUser, "http://test.com/image.jpg", pass);

            //Create one more ad than needed for testing
            for (int i = 0; i < maxReservations + 1; i++)
            {
                toReserve[i] = ads.PostAd(author, "Unit Test - Reserve", "Reserve me.", "Aalborg", AdType.Selling);
            }
        }
Beispiel #5
0
 public static void Cleanup()
 {
     users.DeleteUser(testUser.Id);
     users.DeleteUser(testUser2.Id);
 }