public static void AddBehaviorSpecification(WordprocessingDocument document, BehaviorSpecification behavior) { _log.Info("Printing Behavior Properties: " + behavior.Artifact.Name); var body = document.MainDocumentPart.Document.Body; var aDef = body.AppendChild(new Paragraph()); var adRun = aDef.AppendChild(new Run()); adRun.AppendChild(new Text("Specification Behavior")); Utils.ApplyStyleToParagraph(document, "Heading2", "Heading2", aDef); ArtifactPrinter.AddBehaviorArtifactSpecification(document, behavior.Artifact); ArtifactPrinter.AddArtifactContent(document, behavior.Artifact, false, false, true); var basicProps = new[, ] { { "Is External:", behavior.IsExternal.ToString() }, { "Constructor:", behavior.ConstructorType } }; Utils.AddTable(document, basicProps); //"PlainTable3" CommonPrinter.BuildInvocationBindingsTable(document, behavior.Invocations, behavior.Artifact.Name); var bProps = behavior.Properties.ToArray(); if (bProps.Length > 0) { CommonPrinter.BuildPropertiesTable(document, behavior.Properties, false); } }
private void PopulateBehaviorField(MSpecTestCase testCase, BehaviorSpecification specification) { if (behaviorProperty?.GetValue(specification) is FieldInfo field) { testCase.BehaviorFieldName = field.Name; testCase.BehaviorFieldType = field.FieldType.GenericTypeArguments.FirstOrDefault()?.FullName; } }