Skip to content

Instantly share code, notes, and snippets.

@joshuabezaleel
Created January 8, 2020 03:11
Show Gist options
  • Save joshuabezaleel/292f9be42c8a637ad3dcce412ec701c2 to your computer and use it in GitHub Desktop.
Save joshuabezaleel/292f9be42c8a637ad3dcce412ec701c2 to your computer and use it in GitHub Desktop.
func TestCreate(t *testing.T) {
book := NewBook("testID", "testTitle", "testAuthor")
bookRepository.On("Create", book).Return(book, nil)
createdBook, err := bookService.Create(book)
require.Nil(t, err)
require.Equal(t, createdBook.ID, book.ID)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment