public void Cancelled_Type_Task_T_Should_Be_Cancelled() { var target = TaskBuilder.GetCancelled(typeof(Task <int>)); target.IsCanceled.Should().BeTrue(); target.Should().BeOfType <Task <int> >(); }
public void Cancelled_Type_Task_Should_Be_Cancelled() { var target = TaskBuilder.GetCancelled(typeof(Task)); target.IsCanceled.Should().BeTrue(); target.Should().BeAssignableTo <Task>(); }
public void Intercept(IInvocation invocation) { if (TypeHelper.IsActorCompleteLifeCycleTypeOrBase(invocation.Method.DeclaringType)) { Cancel(invocation); return; } var actor = GetCorrectActor(); if (actor != null) { invocation.ReturnValue = invocation.CallOn(actor); } else { invocation.ReturnValue = TaskBuilder.GetCancelled(invocation.Method.ReturnType); } }
public void Cancelled_Type_Object_Should_Be_Null() { var target = TaskBuilder.GetCancelled(typeof(object)); target.Should().BeNull(); }