예제 #1
0
 public void CreateAdmin_PasswordIsEmpty_ThrowsArgumentException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin(String.Empty);
     }
 }
예제 #2
0
 public void CreateAdmin_PasswordIsWhitespace_ThrowsArgumentException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin(" ");
     }
 }
예제 #3
0
 public void CreateAdmin_PasswordIsNull_ThrowsArgumentNullException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin(null);
     }
 }
예제 #4
0
 public void PlayNextSong_UserIsNotAdministrator_ThrowsInvalidOperationException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin("TestPassword");
         library.ChangeToParty();
         library.PlayNextSong();
     }
 }
예제 #5
0
        public void CreateAdmin_PasswordIsTestPassword_AdministratorIsCreated()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");

                Assert.IsTrue(library.IsAdministratorCreated);
            }
        }
예제 #6
0
        public void ChangeToAdmin_PasswordIsNotCorrent_ThrowsInvalidOperationException()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");

                library.ChangeToAdmin("WrongPassword");
            }
        }
예제 #7
0
        public void ChangeToAdmin_PasswordIsCorrent_AccessModeIsAdministrator()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");
                library.ChangeToAdmin("TestPassword");

                Assert.AreEqual(AccessMode.Administrator, library.AccessMode);
            }
        }
예제 #8
0
        public void AddSongsToPlaylist_PartyModeAndMultipleSongsAdded_ThrowsInvalidOperationException()
        {
            var songs = new[] { new LocalSong("TestPath", AudioType.Mp3, TimeSpan.Zero), new LocalSong("TestPath", AudioType.Mp3, TimeSpan.Zero) };

            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");
                library.ChangeToParty();

                library.AddSongsToPlaylist(songs);
            }
        }
예제 #9
0
        public void AddSongsToPlaylist_PartyModeAndMultipleSongsAdded_ThrowsInvalidOperationException()
        {
            var songs = new[] { new LocalSong("TestPath", AudioType.Mp3, TimeSpan.Zero), new LocalSong("TestPath", AudioType.Mp3, TimeSpan.Zero) };

            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");
                library.ChangeToParty();

                library.AddSongsToPlaylist(songs);
            }
        }
예제 #10
0
        public void ChangeToAdmin_PasswordIsCorrent_AccessModeIsAdministrator()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");
                library.ChangeToAdmin("TestPassword");

                Assert.AreEqual(AccessMode.Administrator, library.AccessMode);
            }
        }
예제 #11
0
        public void PlaySong_UserIsNotAdministrator_ThrowsInvalidOperationException()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");
                library.ChangeToParty();

                library.PlaySong(0);
            }
        }
예제 #12
0
 public void CreateAdmin_PasswordIsWhitespace_ThrowsArgumentException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin(" ");
     }
 }
예제 #13
0
        public void CreateAdmin_PasswordIsTestPassword_AdministratorIsCreated()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");

                Assert.IsTrue(library.IsAdministratorCreated);
            }
        }
예제 #14
0
 public void CreateAdmin_PasswordIsNull_ThrowsArgumentNullException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin(null);
     }
 }
예제 #15
0
 public void CreateAdmin_PasswordIsEmpty_ThrowsArgumentException()
 {
     using (var library = new Library.Library())
     {
         library.CreateAdmin(String.Empty);
     }
 }
예제 #16
0
        public void ChangeToAdmin_PasswordIsNotCorrent_ThrowsInvalidOperationException()
        {
            using (var library = new Library.Library())
            {
                library.CreateAdmin("TestPassword");

                library.ChangeToAdmin("WrongPassword");
            }
        }