public void ListOfUsers_WhenUserIsAddedToAnEmptyListListContainsOneUser() { User user = new User("Janko"); ListOfUsers listOfUsers = new ListOfUsers(); listOfUsers.Add(user); Assert.AreEqual(1, listOfUsers.UserCount); }
public Review(User user, string text, Movie movie) { this.text = text; this.user = user; this.movie = movie; //Prilikom stvaranje recenzije, konstruktoru recenzije treba proslijediti //registriranog korisnika,referencu na film te tekst recenzije }
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 bool Add(User user) { //AkoUListuPokušamoDodatiKorisnikaSImenomKojeVećPostojiListaSeNećePromijeniti if (Contains(user.userName)) return false; listOfUsers.Add(user); return true; }
public bool ChangeText(string changedText, User user) { if (user.userName.Equals(this.user.userName)) { text = changedText; return true; } return false; }
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); }