public void ExpectResponder_TerminatesWithError_IfWaitNotFulfilled() { var task = Never .ThenRespondWithAction("NOP", Nop) .ExpectWithinSeconds(1) .ToTask(this.Executor); Assert.IsFalse(task.IsFaulted); this.Scheduler.AdvanceFrame(OneSecond); Assert.IsNotNull(GetFailureException(task)); }
public void ExpectResponder_ContainsErrorDetails_WhenConditionTimedOut() { var responder = Never.ThenRespondWithAction("Nop", Nop); this.AssertErrorDetailsAfterOneSecond( responder.ExpectWithinSeconds(1), @"timed out.* \[!\] Nop EXPECTED WITHIN [^!]* Failed with.* Test operation stack"); }
public void Until_Description_MatchesExpected() { var state = Never .ThenRespondWithAction("complete", _ => { }) .Optionally() .Until(Never) .CreateState(); StateAssert.StringContainsInOrder(state.ToString()) .Details("UNTIL") .NotStarted("Never") .Details("RESPOND TO ANY OF") .NotStarted("complete"); }
public void Until_TimesOut_AsExpected() { var completed = false; var task = Never .ThenRespondWithAction("complete", _ => completed = true) .Optionally() .Until(Never) .ExpectWithinSeconds(1) .ToTask(this.Executor); this.Scheduler.AdvanceFrame(OneSecond); Assert.IsFalse(completed); Assert.IsNotNull(GetFailureException(task)); }