public void ConfigureByDefault() { ConfigureBaseAtataContext() .AddNLogFileLogging() .Build(); WriteLogMessageAndAssertItInFile( Path.Combine(DefaultAtataContextArtifactsDirectory.BuildPath(), $"{AtataContext.Current.TestName}.log")); }
public void ConfigureWithFileName() { string fileName = Guid.NewGuid().ToString(); ConfigureBaseAtataContext() .AddNLogFileLogging() .WithFileName(fileName) .Build(); WriteLogMessageAndAssertItInFile( Path.Combine(DefaultAtataContextArtifactsDirectory.BuildPath(), fileName)); }
public void NLogConsumer() { ConfigureBaseAtataContext(). AddNLogLogging(). Build(); string testMessage = Guid.NewGuid().ToString(); AtataContext.Current.Log.Info(testMessage); string filePath = Path.Combine( DefaultAtataContextArtifactsDirectory.BuildPath(), $"{AtataContext.Current.TestName}.log"); AssertThatFileShouldContainText(filePath, testMessage); }