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));
        }
Example #2
0
        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"));;
        }