public async Task <BaseResponseWrapper> UpdateUserTeam(UserTeam userTeam) { try { await fantasySoccerService.UpdateUserTeamAsync(userTeam); var response = new BaseResponseWrapper { StatusCode = Models.Responses.StatusCode.OK, Message = "The user team has been updated successful" }; return(response); } catch (Exception exception) { var response = new BaseResponseWrapper { StatusCode = Models.Responses.StatusCode.BadRequest, Message = exception.Message }; return(response); } }
public async Task UpdateUserTeamAsync_UserTeamHasLessThan11Starters_ReturnsException() { //arrange var userTeam = new UserTeam { ID = "1", UserPlayFabID = fakePlayFabService.PlayFabId, MatchdayScores = new Dictionary <int, int> { }, Players = DataHelper.GetDummyPlayers(1, 1) }; //act async Task actual() { await fantasySoccerService.UpdateUserTeamAsync(userTeam); } //assert await Assert.ThrowsAsync <Exception>(actual); }