public MainWindow()
 {
     InitializeComponent();
     if (Infrastructure1.LoadListOfUsers() != null)
     {
         UserManager1.UpdateUserList(Infrastructure1.LoadListOfUsers());
     }
 }
 public void RemoveUser_ShouldReturnStatusError()
 {
     UserManager.UserManager users = new UserManager.UserManager();
     List<User> userList = new List<User>();
     userList.AddRange(new User[] { new User("1"), new User("2"), new User("3"), new User("4")});
     users.UpdateUserList(userList);
     users.RemoveUser("2");
     Assert.AreEqual(null, users.GetUserListOfSongs("2"));
 }
 public void GetAndUpdateList_IDOfFirstAndFourthUsersShouldBeTheSameInBothListAndInsertedArray()
 {
     UserManager.UserManager users = new UserManager.UserManager();
     List<User> userList = new List<User>();
     userList.AddRange(new User[] { new User("1"), new User("2"), new User("3"), new User("4")});
     users.UpdateUserList(userList);
     Assert.AreEqual("1", users.GetListOfUsers()[0].ID);
     Assert.AreEqual("4", users.GetListOfUsers()[3].ID);
 }
Beispiel #4
0
        public void RemoveUser_ShouldReturnStatusError()
        {
            UserManager.UserManager users    = new UserManager.UserManager();
            List <User>             userList = new List <User>();

            userList.AddRange(new User[] { new User("1"), new User("2"), new User("3"), new User("4") });
            users.UpdateUserList(userList);
            users.RemoveUser("2");
            Assert.AreEqual(null, users.GetUserListOfSongs("2"));
        }
Beispiel #5
0
        public void GetAndUpdateList_IDOfFirstAndFourthUsersShouldBeTheSameInBothListAndInsertedArray()
        {
            UserManager.UserManager users    = new UserManager.UserManager();
            List <User>             userList = new List <User>();

            userList.AddRange(new User[] { new User("1"), new User("2"), new User("3"), new User("4") });
            users.UpdateUserList(userList);
            Assert.AreEqual("1", users.GetListOfUsers()[0].ID);
            Assert.AreEqual("4", users.GetListOfUsers()[3].ID);
        }
 public void GetUserListOfSongs_IDOfSecondSongShouldBe10()
 {
     UserManager.UserManager users = new UserManager.UserManager();
     List<User> userList = new List<User>();
     List<Song> userSongList1 = new List<Song>(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4)});
     List<Song> userSongList2 = new List<Song>(new Song[] { new Song(5), new Song(6), new Song(7), new Song(8) });
     List<Song> userSongList3 = new List<Song>(new Song[] { new Song(9), new Song(10), new Song(11), new Song(12) });
     List<Song> userSongList4 = new List<Song>(new Song[] { new Song(13), new Song(14), new Song(15), new Song(16) });
     userList.AddRange(new User[] { new User("1", "1", userSongList1), new User("2", "2", userSongList2),
                         new User("3", "3", userSongList3), new User("4", "4", userSongList4) });
     users.UpdateUserList(userList);
     Assert.AreEqual(10, users.GetUserListOfSongs("3")[1].ID);
 }
Beispiel #7
0
        public void GetUserListOfSongs_IDOfSecondSongShouldBe10()
        {
            UserManager.UserManager users         = new UserManager.UserManager();
            List <User>             userList      = new List <User>();
            List <Song>             userSongList1 = new List <Song>(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) });
            List <Song>             userSongList2 = new List <Song>(new Song[] { new Song(5), new Song(6), new Song(7), new Song(8) });
            List <Song>             userSongList3 = new List <Song>(new Song[] { new Song(9), new Song(10), new Song(11), new Song(12) });
            List <Song>             userSongList4 = new List <Song>(new Song[] { new Song(13), new Song(14), new Song(15), new Song(16) });

            userList.AddRange(new User[] { new User("1", "1", userSongList1), new User("2", "2", userSongList2),
                                           new User("3", "3", userSongList3), new User("4", "4", userSongList4) });
            users.UpdateUserList(userList);
            Assert.AreEqual(10, users.GetUserListOfSongs("3")[1].ID);
        }