Skip to content

Commit

Permalink
Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCleary committed Dec 10, 2014
1 parent 5b76ef1 commit bcfe053
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -2,3 +2,21 @@ AsyncUnitTests
==============

Helpers for async unit testing.

Async-Aware Default Stub Behavior for Microsoft Fakes
=====================================================

The built-in default stub behavior for Microsoft Fakes will return `null` tasks from asynchronous methods. The [Nito.AsyncEx.UnitTests.MSFakes NuGet package](https://www.nuget.org/packages/Nito.AsyncEx.UnitTests.MSFakes/) provides the `AsyncAwareDefaultValueStubBehavior` type.

Recommended usage is to apply the async-aware default stub behavior to all unit tests in a project:

[AssemblyInitialize]
public static void Initialize(TestContext context)
{
StubBehaviors.Current = new Nito.Async.UnitTests.AsyncAwareDefaultValueStubBehavior();
}

However, it can be set on a test-by-test basis:

var stub = new Stub...;
stub.InstanceBehavior = new Nito.Async.UnitTests.AsyncAwareDefaultValueStubBehavior();

0 comments on commit bcfe053

Please sign in to comment.