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

        }
Beispiel #5
0
        public bool Add(User user)
        {

            //AkoUListuPokušamoDodatiKorisnikaSImenomKojeVećPostojiListaSeNećePromijeniti 
            if (Contains(user.userName))
                return false;
            
            listOfUsers.Add(user);
            return true;
        }
Beispiel #6
0
        public bool ChangeText(string changedText, User user)
        {
            if (user.userName.Equals(this.user.userName))
            {
                text = changedText;
                return true;
            }
            return false;

        }
Beispiel #7
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);
        }