AssertEx - a set of simple assert extensions to give you more choices and easier to read tests.
PowerShell C#
Failed to load latest commit information.
.nuget Project file, unit tests, etc. Jun 7, 2012
Build updated scripts to call xunit test runner after compile Jul 6, 2012
Source Re-merge pull request #4 from shiftkey/NET4-Tests Jul 16, 2012
Tools added xunit test runner Jul 6, 2012
.gitignore updated gitignore to include temp files and artifacts from NuGet crea… Jul 5, 2012
AssertExLib.sln Added license file Jun 7, 2012
create-release.ps1 added helper scripts from other project Jul 5, 2012


AssertEx is a simple library of helper methods for unit testing. Originally created for use with MS-Test, it is framework neutral so should be usable with any .NET unit testing framework.



The static class that contains the helper methods

Standard Exception Helpers

  • AssertEx.DoesNotThrow(delegate testCode)
  • AssertEx.Throws(Type type, delegate testCode)
  • AssertEx.Throws<T>(delegate testCode)

Task-Async Exception Helpers

  • AssertEx.TaskDoesNotThrow(delegate testCode)
  • AssertEx.TaskDoesNotThrow<T>(delegate testCode)
  • AssertEx.TaskThrows(Type type, delegate testCode)
  • AssertEx.TaskThrows<T>(delegate testCode)


An exception class that is used by AssertEx when an assertion fails. Nothing fancy here.


Many thanks to Jim Newkirk and Brad Wilson for the whole Assert.Throws() thing in, from which this work is obviously and blatantly derived. And to shiftkey for the Task-Async versions.