/// <summary> /// Translate this instance to json /// </summary> public RavenJObject ToJson() { var jObject = new RavenJObject { { "Type", new RavenJValue(Type.ToString()) }, { "Value", Value }, { "Name", new RavenJValue(Name) } }; if (Position != null) { jObject.Add("Position", new RavenJValue(Position.Value)); } if (Nested != null) { jObject.Add("Nested", new RavenJArray(Nested.Select(x => x.ToJson()))); } if (AllPositions != null) { jObject.Add("AllPositions", new RavenJValue(AllPositions.Value)); } if (PrevVal != null) { jObject.Add("PrevVal", PrevVal); } return(jObject); }
public JObject ToJson() { var jObject = new JObject( new JProperty("Type", new JValue(Type)), new JProperty("Value", Value), new JProperty("Name", new JValue(Name)), new JProperty("Position", Position == null ? null : new JValue(Position.Value)), new JProperty("Nested", Nested == null ? null : new JArray(Nested.Select(x => x.ToJson()))) ); if (PrevVal != null) { jObject.Add(new JProperty("PrevVal", PrevVal)); } return(jObject); }
internal new TestResultsHolder Clone() { return(new TestResultsHolder { Id = Id, ParentId = ParentId, IsSuite = IsSuite, Name = Name, Skipped = Skipped, Failure = Failure, Duration = Duration, Failures = Failures.ToList(), Nested = new List <SuiteOrTest>(Nested.Select(n => n.Clone())), Logs = Logs.ToList(), UserAgent = UserAgent, Running = Running, TestsFailed = TestsFailed, TestsFinished = TestsFinished, TestsSkipped = TestsSkipped, TotalTests = TotalTests }); }
public override string ToString() { return("(" + string.Join(",", Nested.Select(i => Nested[0].Nested != null ? i.ToString() : i.Singleton.ToString())) + ")"); }