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

Theory data in tests should include expected output #36

Open
RPM1984 opened this issue Oct 16, 2020 · 0 comments
Open

Theory data in tests should include expected output #36

RPM1984 opened this issue Oct 16, 2020 · 0 comments

Comments

@RPM1984
Copy link
Member

RPM1984 commented Oct 16, 2020

Currently we use theory data to control assertions, e.g here

This leads to some 'magic code' / checks, e.g:

if (id == 1)
{
    // some assertion
}

A better approach would be to setup the data in the controller/models via the tests (not hardcoded internally), and have the theory data include the expected model.

Then the assertions become a simple equality check on the JSON output.

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