Example #1
0
 private static IEnumerable <string> FailureLines(
     ITestOperationState rootOperation,
     string what)
 => new[]
 {
     $"Test operation execution {what}!",
     $"Failure context:\n{StateStringBuilder.MakeState(rootOperation)}",
 };
Example #2
0
 private IEnumerable <string> MakeGlobalContext()
 {
     if (this.globalContextProvider != null)
     {
         var builder = new StateStringBuilder();
         builder.AddNestedDetails("Global context:", this.globalContextProvider.BuildGlobalContext);
         yield return(builder.ToString());
     }
 }
Example #3
0
 private void AddDetails(StateStringBuilder stateBuilder)
 {
     try
     {
         var messageWriter = new TextMessageWriter();
         this.constraint.ApplyTo(this.getObject()).WriteMessageTo(messageWriter);
         stateBuilder.AddDetails(messageWriter.ToString());
     }
     catch (Exception e)
     {
         stateBuilder.AddDetails($"Failed to get description:\n{e}");
     }
 }
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddContinuation(this.first, new ContinuationState.Available(this.second));
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddContinuation(this.first, this.continuation.State);
Example #6
0
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddInstruction(this, this.description);
Example #7
0
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddExpectWithin(this, this.timeout, this.condition);
 public void BuildDescription(StateStringBuilder builder) => throw new NotImplementedException();
Example #9
0
 public override void BuildDescription(StateStringBuilder builder) => builder.AddResponder(this);
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddInstruction(this, $"WAIT FOR {this.wholeFramesToWaitFor} FRAME(S)");
Example #11
0
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddParentWithChildren(
     "WAIT FOR ALL OF",
     this,
     this.conditions);
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddToPreviousLineWithChildren(" ANY OF", this.responders);
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddInstruction(this, $"WAIT FOR {this.waitTime:g}");
Example #14
0
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddContinuation(this.first, this.nextInstruction);
 public override void BuildDescription(StateStringBuilder builder) =>
 builder.AddSelect <T1, T2>(
     this.responder,
     this.selectState?.SelectStatus ?? TestOperationStatus.NotExecuted.Instance);