public async Task Create_ShouldReturnOK() { var entryBook = FakeObjects.FakeObjects.GetListEntryBook(); await _entryBookService.CreateEntry(entryBook[0]); var actionResult = await _sut.Post(entryBook[0]); actionResult.Result.Equals(typeof(OkObjectResult)); }
public async Task <ActionResult <EntryBookDto> > Post([FromBody] EntryBookDto value) { var created = await _entryBookService.CreateEntry(value); if (created) { return(Ok(value)); } return(BadRequest("Either Duplicate primary key or no person name"));; }