Closed nestalk closed 11 years ago
Interesting. The problem that this library is much more widely useful if it's not tied to nunit.
I have already gone a bit of the way down the route that the assert engine is replaceable (and as it turns out, this is very useful for tests). Nunit is still the default though. But this is a different approach to the problem.
Perhaps this should be the default assert engine, and the nunit wrapper one an optional plugin? But I don't want to make a second nuget package just to hold the +-30 lines of code that interface with nunit.
I haven't had time to work on this; I should after the next few days. I'm now thinking that this should be the default assert engine and the nunit assert engine should be an example/demo of how to integrate closer with nunit if you are using unit (i.e used in the self-test project, not the main package). Examples of same for xUnit, MSText, etc are appreciated but are probably easy for the user to do themselves.
Merged. If you have examples of IAssertEngine for xUnit and MSTest, I'd like to have them.
Instead of using nunit methods to cause a failure the AssertEngine throws a a custom exception that the unit test frameworks will register as a failure. We do however lose the extra information that nunit provides when comparing strings.
I tested this with the NUnit, xUnit and MSTest frameworks and all three returned the same results when given the same test methods.