public void DefaultStubBehavior_TaskOfIntReturnType_ReturnsNullTask() { var stub = new StubIService() as IService; var task = stub.ReturnIntAsync(); Assert.IsNull(task); }
public void AsyncStubBehavior_TaskOfIntReturnType_ReturnsCompletedTask() { var stub = new StubIService { InstanceBehavior = new AsyncAwareDefaultValueStubBehavior() } as IService; var task = stub.ReturnIntAsync(); Assert.IsNotNull(task); Assert.IsTrue(task.IsCompleted && !task.IsFaulted && !task.IsCanceled); Assert.AreEqual(0, task.Result); }