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

Syntax for multiple assertions #29

Open
provegard opened this issue Oct 11, 2019 · 1 comment
Open

Syntax for multiple assertions #29

provegard opened this issue Oct 11, 2019 · 1 comment
Labels

Comments

@provegard
Copy link
Collaborator

Should be avoided, but may be useful.

  expect.multiple(Seq(
    expect(...).toEqual(...),
    expect(...).toMatch(...)
  ))

NUnit's Assert.Multiple is not really equivalent since we need our tests to return an Expectation. So we need a compound Expectation here.

Perhaps a params array is nicer:

  expect.multiple(
    expect(...).toEqual(...),
    expect(...).toMatch(...)
  )

@eliasson thoughts?

@provegard provegard added the question Further information is requested label Oct 11, 2019
@eliasson
Copy link
Contributor

Not sure it is a good thing to introduce multiple asserts. Given that you setup the test-state accordingly, having multiple tests should be as easy (with the bonus of a descriptive label).

If we go this way I think it would be nice to enable / disable it with a compiler flag and fail compilation with multiple inserts.

Maybe it is better to post-pone this feature a while longer?

(For syntax though, the params one is better)

@provegard provegard added postpone and removed question Further information is requested labels Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants