Exemple #1
0
 public void ListOfUsers_WhenUserIsAddedToAnEmptyListListContainsOneUser()
 {
     User user = new User("Janko");
     ListOfUsers listOfUsers = new ListOfUsers();
     listOfUsers.Add(user);
     Assert.AreEqual(1, listOfUsers.UserCount);
 }
Exemple #2
0
 public void ListOfUsers_WhenUserIsAddedHeIsInTheList()
 {
     ListOfUsers list = new ListOfUsers();
     string username = "******";
     User user = new User(username);
     list.Add(user);
     Assert.IsTrue(list.Contains(username));
 }
Exemple #3
0
        public void ListOfUsers_WhenUserIsAddedListIncreasesByOne()
        {
            ListOfUsers list = new ListOfUsers();
            Assert.AreEqual(0, list.UserCount);
            User user = new User("Janko");
            list.Add(user);
            Assert.AreEqual(1, list.UserCount);

        }
Exemple #4
0
        public void ListOfUsers_AddMethodReturnsFalseIfUsernameAlreadyExists()
        {
            ListOfUsers list = new ListOfUsers();
            User user = new User("Janko");

            Assert.IsTrue(list.Add(user));
            user = new User("Janko");
            
            Assert.IsFalse(list.Add(user));
            Assert.AreEqual(1, list.UserCount);
        }