public void CreateAdmin_PasswordIsEmpty_ThrowsArgumentException() { using (var library = new Library.Library()) { library.CreateAdmin(String.Empty); } }
public void CreateAdmin_PasswordIsWhitespace_ThrowsArgumentException() { using (var library = new Library.Library()) { library.CreateAdmin(" "); } }
public void CreateAdmin_PasswordIsNull_ThrowsArgumentNullException() { using (var library = new Library.Library()) { library.CreateAdmin(null); } }
public void PlayNextSong_UserIsNotAdministrator_ThrowsInvalidOperationException() { using (var library = new Library.Library()) { library.CreateAdmin("TestPassword"); library.ChangeToParty(); library.PlayNextSong(); } }
public void CreateAdmin_PasswordIsTestPassword_AdministratorIsCreated() { using (var library = new Library.Library()) { library.CreateAdmin("TestPassword"); Assert.IsTrue(library.IsAdministratorCreated); } }
public void ChangeToAdmin_PasswordIsNotCorrent_ThrowsInvalidOperationException() { using (var library = new Library.Library()) { library.CreateAdmin("TestPassword"); library.ChangeToAdmin("WrongPassword"); } }
public void ChangeToAdmin_PasswordIsCorrent_AccessModeIsAdministrator() { using (var library = new Library.Library()) { library.CreateAdmin("TestPassword"); library.ChangeToAdmin("TestPassword"); Assert.AreEqual(AccessMode.Administrator, library.AccessMode); } }
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); } }
public void PlaySong_UserIsNotAdministrator_ThrowsInvalidOperationException() { using (var library = new Library.Library()) { library.CreateAdmin("TestPassword"); library.ChangeToParty(); library.PlaySong(0); } }