Helpers for async unit testing.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Nito.AsyncEx.UnitTests/MSFakes Changed icon to 128x128. Dec 10, 2014
.gitignore Athena Dec 10, 2014
AsyncExUnitTests.128.png NuSpec and icon updates. Dec 10, 2014
LICENSE Initial commit Dec 10, 2014 Better readme. Dec 10, 2014


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 provides the AsyncAwareDefaultValueStubBehavior type.

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

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();