Skip to content

Commit

Permalink
Better readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCleary committed Dec 10, 2014
1 parent bcfe053 commit 631fcb2
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
@@ -1,22 +1,23 @@
AsyncUnitTests
==============

Helpers for async unit testing.
![logo](https://github.com/StephenCleary/AsyncUnitTests/raw/master/AsyncExUnitTests.128.png)

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();
}
````C#
[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();
````C#
var stub = new Stub...;
stub.InstanceBehavior = new Nito.Async.UnitTests.AsyncAwareDefaultValueStubBehavior();
````

0 comments on commit 631fcb2

Please sign in to comment.