public void ListOfUsers_WhenUserIsAddedToAnEmptyListListContainsOneUser() { User user = new User("Janko"); ListOfUsers listOfUsers = new ListOfUsers(); listOfUsers.Add(user); Assert.AreEqual(1, listOfUsers.UserCount); }
public void ListOfUsers_WhenUserIsAddedHeIsInTheList() { ListOfUsers list = new ListOfUsers(); string username = "******"; User user = new User(username); list.Add(user); Assert.IsTrue(list.Contains(username)); }
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); }
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); }