protected void SetContext(string testContext) { TestLogContext.ResetContext(); var json = testContext.DecodeBase64(); var ctx = JsonConvert.DeserializeObject <YamlTestContext>(json); TestCounter++; Context = ctx; }
private void SetupFluentAssertion() { //Hook into FluentAssertion so we see very useful //YamlTest context information. TestLine, expected, got, etc... FluentAssertions.Common.Services.ResetToDefaults(); var hook = FluentAssertions.Common.Services.ThrowException; FluentAssertions.Common.Services.ThrowException = s => { var logContext = TestLogContext.LogText(); hook(logContext + s); }; }
public virtual void BeforeEachTest() { EnsureConnection(); try { CreateTable(DbName, TableName); } catch { } TestLogContext.ResetContext(); }
public virtual void BeforeEachTest() { Converter.InitializeDefault(); EnsureConnection(); try { CreateTable(DbName, TableName); } catch { } TestLogContext.ResetContext(); }
public override string ToString() { var sb = new StringBuilder(); sb.AppendLine(); sb.AppendLine($"Test:"); sb.AppendLine($"\t{TestFile}, LineNum: {LineNum}"); sb.AppendLine("Expected ReQL:"); sb.AppendLine($"\t{ExpectedOriginal}"); sb.AppendLine("Expected C#/Java:"); sb.AppendLine($"\t{ExpectedJava}"); sb.AppendLine("Run ReQL:"); sb.AppendLine($"\t{Original}"); sb.AppendLine("Run C#/Java:"); sb.AppendLine($"\t{Java}"); sb.AppendLine($"RunOpts: {JsonConvert.SerializeObject(RunOpts)}"); sb.AppendLine(TestLogContext.LogText()); sb.AppendLine(); return(sb.ToString()); }
public static void ResetContext() { Context = new TestLogContext(); }