private void AddByInteractions(List <VerificationRecord> verificationRecords, Dictionary <string, string> result) { foreach (var verificationRecord in verificationRecords) { string interactionTag = _tagger.TagInteraction(verificationRecord.Interaction); if (result.ContainsKey(interactionTag)) { result.Remove(interactionTag); } result.Add(interactionTag, verificationRecord.Success?"Success":"Failure"); } }
private TableRow Row(VerificationRecord record) { var tableRow = new TableRow(); tableRow.Cells.Add(new TableCell()); string tag = _tagger.TagInteraction(record.Interaction); tableRow.Cells.Add(new TableCell( new Italic(new Text(tag)) ).Attribute("class", "table-cell") as TableCell); tableRow.Cells.Add(new TableCell( new Italic(new Text($"{record.Interaction.ConsumerName}::{record.Interaction.ProviderName}")) ).Attribute("class", "table-cell") as TableCell); tableRow.Cells.Add(new TableCell( new Italic(new Text(record.Interaction.RequestPath)) ).Attribute("class", "table-cell") as TableCell); var status = record.Success ? "PASS" : "FAIL"; tableRow.Cells.Add(new TableCell( new Bold(new Text(status)) ).Attribute("class", "table-cell table-cell-" + status.ToLower()) as TableCell); tableRow.Cells.Add(new TableCell( new Text(ParagraphEncode(record.Logs)) ).Attribute("class", "table-cell details-paragraph") as TableCell); return(tableRow); }
public bool InterceptPactBeforeVerification(Models.Pact pact, Interaction runningInteraction) { string tag = _tagger.TagInteraction(new InteractionInfo().UpdateFrom(pact, runningInteraction)); string link = ResolveUrl(this._verificationResultBrokerLink, tag); if (pact._links == null) { pact._links = new BrockerApi(); } pact._links[VerificationResultKey] = new Link { Title = "Publish verification results", Href = link }; return(true); }