Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some test cases doesn't really works #1

Open
sinetoami opened this issue Oct 18, 2019 · 0 comments
Open

Some test cases doesn't really works #1

sinetoami opened this issue Oct 18, 2019 · 0 comments

Comments

@sinetoami
Copy link

Seems this piece of test case doesn't really work:

expected := Bird{"sparrow", "A small harmless bird"}
b := []Bird{}
err = json.NewDecoder(recorder.Body).Decode(&b)
if err != nil {
t.Fatal(err)
}
actual := b[0]

The test case doesn't use the birds array, by the way.

birds = []Bird{
{"sparrow", "A small harmless bird"},
}

The func TestCreateBirdsHandler(t *testing.T) doesn't work as expected too.

I'm trying to learn how to build a REST API application and your tutorial is pretty great because you explain all the construction with tests. So, I'm stuck on this part to move forward. So, can you help to figure out this part of the code?

Thanks for the great tutorial and for your attention!
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant