private static IEnumerable <string> FailureLines( ITestOperationState rootOperation, string what) => new[] { $"Test operation execution {what}!", $"Failure context:\n{StateStringBuilder.MakeState(rootOperation)}", };
private IEnumerable <string> MakeGlobalContext() { if (this.globalContextProvider != null) { var builder = new StateStringBuilder(); builder.AddNestedDetails("Global context:", this.globalContextProvider.BuildGlobalContext); yield return(builder.ToString()); } }
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);
public override void BuildDescription(StateStringBuilder builder) => builder.AddInstruction(this, this.description);
public override void BuildDescription(StateStringBuilder builder) => builder.AddExpectWithin(this, this.timeout, this.condition);
public void BuildDescription(StateStringBuilder builder) => throw new NotImplementedException();
public override void BuildDescription(StateStringBuilder builder) => builder.AddResponder(this);
public override void BuildDescription(StateStringBuilder builder) => builder.AddInstruction(this, $"WAIT FOR {this.wholeFramesToWaitFor} FRAME(S)");
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}");
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);