public async Task CreateGame_Success() { //Arrange var entity = new GameBuilder().Build(); //Act var response = await _gameDomainService.CreateAsync(entity); //Assert response.Should().NotBeEmpty(); }
public async Task <Response <Object> > Create(GameDto game) { var response = new Response <Object>(); try { var gameEntity = _mapper.Map <Game>(game); var result = await _gameDomainService.CreateAsync(gameEntity); return(response.SetResult(new { Id = result })); } catch (ValidationException ex) { return(response.SetRequestValidationError(ex)); } catch (Exception ex) { Console.Write(ex.Message); return(response.SetInternalServerError(Resources.UnexpectedErrorWhileCreatingGame)); } }