Pregunta

I'm using Specflow with xUnit, should I have an Assert with void Table.CompareToSet() (in the TechTalk.SpecFlow.Assist helpers)

Or it throwing an exception enough? If it throws any sort of exception it should fail (which it does fail ok), but I'm unsure whether I should be stricter by explicitly having an Assert?

¿Fue útil?

Solución

Having an exception is enough.

Don't forget, SpecFlow doesn't actually run your tests. It delegates that to NUnit/xUnit/MsTest. So if your code would fail the test in one of those it should also fail in SpecFlow.

BTW, If you write your test first before you write your functional code then of course your test will fail, and that process checks that your fail will work, so you would see for yourself if this is sufficient. ;-)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top