#TestsEx 0.3.0 was released yesterday.
News
The first news is that #TestsEx is no more a “one-man-show”; Jason Diamond is now part of the team.
The second news is that the new syntax, based on lambda expression, is now available (similar to the one available in NUnitEx). You can see an example in the download page.
var var2 = 2;
2.Satisfy(a => var2 == a);
1.Satisfy(a => a == 1 || a != 0);
The mayor advantage of the “Satisfy syntax” is that it is pure C#; perhaps is less readable but you don’t need to know the name of an assertion and its “extensible limit” is the same you have in C#. Even if this feature is available and can be used right now, we are working to improve the failure message.
The breaking change
Perhaps this is the first time I’m happy to announce a breaking change. Starting from this release, to use #TestsEx extensions, you must specify the using clause.
using SharpTestsEx;
Why ? #TestsEx, now can be used with your preferred unit test framework.
We are supporting MsTests, NUnit and xUnit.
For MsTests
You must add the reference to SharpTestsEx.MSTest.dll in your test project.
For NUnit
You must add the reference to SharpTestsEx.NUnit.dll in your test project.
For xUnit
You must add the reference to SharpTestsEx.xUnit.dll in your test project.
For others
For others frameworks you can use SharpTestsEx.dll but, probably, you will see SharpTestsEx in the stack trace of the failure message in your test runner.
If you are working in various projects, using various unit tests frameworks, now you have one more reason to use #TestsEx.
Important
Sharp Tests Extensions is a compendium of commons “extensible extensions” to work with your preferred unit test framework and not another test framework.
The Syntax overview is available here.
Happy testing!!
Great work! I have been using the first version on nUnit, and my company is now stuck with MSTest.. love to use the same elegant syntax for both places now :)
ReplyDeleteLove the "Satisfy Syntax"! Keep it going! :)
New "sharptestsex" with "satisfy syntax"? It all depends on where you divide up the words... :)
ReplyDelete@DoniG
ReplyDeleteFor sure!!! LOL
Non only useful but even funny.
Any plans to support mbUnit out of the box?
ReplyDeleteSure. In theory it should be easy.
ReplyDeleteTo have an idea this is all we need to full support xUnit http://tinyurl.com/y9me5ev
and this is all we need to full support NUnit
http://tinyurl.com/yc3rzap
btw you can actually use #TestsEx using SharpTestsEx.dll
If you have time to try it with MbUnit we will be happy.
I'm sorry, but how could you possibly want this over something like this:
ReplyDelete// Assert
var2.ShouldBeExactly( 2 );
Sheesh, this is technomasturbation!
@Pedro
ReplyDeleteTry to extend it, try to write it without know the assertion name, try to concatenate assertions over the same value under test.
Btw nobody said you must use something.
#TestsEx is not a substitution of your preferred test FX.
Does SharpTestEx covers all the functionality provided by NUnitEx (and with the compatible syntax)?
ReplyDeleteIf so, should i stop using NUnitEx and start using SharpTestExt.
What would you recommend? Did you change you existing tests that were writed with NUnitEx to make them use SharpTestEx.
@Vansha
ReplyDeleteYes it does.
I'll continue maintaining NUnitEx for new versions of NUnit.
So far I have replaced NUnitEx with #TestsEx only in one prj.
And for future projects you will use #TestEx, even if all tests will be writen for NUnit. Right?
ReplyDeleteThank you for great work!
Yes I do.
ReplyDelete