Skip to content

Instantly share code, notes, and snippets.

@plaurin
Created September 1, 2012 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plaurin/3563082 to your computer and use it in GitHub Desktop.
Save plaurin/3563082 to your computer and use it in GitHub Desktop.
TryCache exemple
[SetUp]
public void SetUp()
{
this.memoryAppender = new MemoryAppender();
BasicConfigurator.Configure(this.memoryAppender);
...
}
[Test]
public void TestSomething()
{
...
// Assert
Assert.IsFalse(
this.memoryAppender.GetEvents().Any(le => le.Level == Level.Error),
"Did not expect any error messages in the logs");
}
public void DoSomething()
{
try
{
ReallyDoSomething();
}
catch (Exception ex)
{
this.logger.LogError("An error occured!", ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment