public void ItThrowsAUserHasNoGamingGroupExceptionIfTheUserHasNoGamingGroup() { _currentUser.CurrentGamingGroupId = null; var expectedException = new UserHasNoGamingGroupException(_currentUser.Id); var actualException = Assert.Throws <UserHasNoGamingGroupException>(() => _autoMocker.ClassUnderTest.CreatePlayer(_createPlayerRequest, _currentUser)); Assert.AreEqual(expectedException.Message, actualException.Message); }
public void It_Throws_A_UserHasNoGamingGroupException_If_ApplicationUser_Current_Gaming_Group_Is_Null() { _currentUser.CurrentGamingGroupId = null; _currentUser.Id = "some user id"; var expectedException = new UserHasNoGamingGroupException(_currentUser.Id); var actualException = Assert.Throws <UserHasNoGamingGroupException>(() => _autoMocker.ClassUnderTest.ImportBoardGameGeekGames(_currentUser)); actualException.Message.ShouldBe(expectedException.Message); }
public void ItThrowsAUserHasNoGamingGroupExceptionIfTheCurrentUserHasNoGamingGroupAndSavingASecuredEntityThatIsntAGamingGroup() { var user = new ApplicationUser { Id = "some user id" }; var expectedException = new UserHasNoGamingGroupException(user.Id); var actualException = Assert.Throws <UserHasNoGamingGroupException>(() => dataContext.Save(new GameDefinition(), user)); Assert.AreEqual(expectedException.Message, actualException.Message); }
public void It_Throws_A_UserHasNoGamingGroupException_If_The_Inviting_User_Has_No_Gaming_Group() { //--arrange _currentUser.CurrentGamingGroupId = null; var expectedException = new UserHasNoGamingGroupException(_currentUser.Id); //--act var actualException = Assert.Throws <UserHasNoGamingGroupException>(() => _playerInviter.InvitePlayer(_playerInvitation, _currentUser)); //--assert actualException.Message.ShouldBe(expectedException.Message); }
public void It_Throws_A_UserHasNoGamingGroupException_If_The_User_Has_No_Gaming_Group() { //--arrange _currentUser.CurrentGamingGroupId = null; var expectedException = new UserHasNoGamingGroupException(_currentUser.Id); //--act var actualException = Assert.Throws <UserHasNoGamingGroupException>( () => _autoMocker.ClassUnderTest.Execute((CreateGameDefinitionRequest)null, _currentUser, _dataContextMock)); //--assert actualException.Message.ShouldBe(expectedException.Message); }
public void It_Throws_A_UserHasNoGamingGroupException_If_The_Current_User_Doesnt_Have_An_Active_Gaming_Group() { //--arrange var expectedException = new UserHasNoGamingGroupException(_currentUser.Id); _currentUser.CurrentGamingGroupId = null; //--act var actualException = Assert.Throws <UserHasNoGamingGroupException>( () => _autoMocker.ClassUnderTest.Execute(CreateValidNewlyCompletedGame(), _currentUser, _dataContext)); //--assert actualException.Message.ShouldBe(expectedException.Message); }