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

Do we need to check saved data? #1

Open
ildar-shaymukhametov opened this issue May 27, 2023 · 1 comment
Open

Do we need to check saved data? #1

ildar-shaymukhametov opened this issue May 27, 2023 · 1 comment

Comments

@ildar-shaymukhametov
Copy link

var addResponse = await client.PostAsJsonAsync("todo", new { 
            title = "New Todo",
            description = "Description of the todo"
        });

Assert.Equal(System.Net.HttpStatusCode.OK, addResponse.StatusCode);

Here you do not test if saved item actually has title "New Todo" in db (what it if it was not assigned at all?)
My question is why?

@ITHedgeHog
Copy link

This is from Martin's NDC Conference Talk Building Operable Software with TDD (but not the way you think). He explains this in the video why it doesn't test that- you want about 19 minutes in for your specific question.

But I really suggest you watch the whole talk https://www.youtube.com/watch?v=prLRI3VEVq4 it explains several important things @ildar-shaymukhametov

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

2 participants