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
UnitTests.NET4
UnitTests
.gitignore updated gitignore to include temp files and artifacts from NuGet crea… Jul 5, 2012
AssertExLib.sln
LICENSE.md Added license file Jun 7, 2012
README.md
build-and-test.ps1
create-release.ps1 added helper scripts from other project Jul 5, 2012

README.md

AssertEx

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.

API

AssertEx

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)

AssertExException

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

Credits

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