Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created August 23, 2012 01:24
Show Gist options
  • Select an option

  • Save ElemarJR/3431083 to your computer and use it in GitHub Desktop.

Select an option

Save ElemarJR/3431083 to your computer and use it in GitHub Desktop.
[TestMethod]
public void Ctor_PassingOutput_ShouldCallWrite()
{
var invoked = false;
var stub = new StubIOutput()
{
WriteLogEntry = (entry) =>
{
invoked = true;
}
};
var l = new LogEntry("Some Message", stub);
Assert.IsTrue(invoked, "Write of output should be invoked");
}
[TestMethod]
public void Ctor_PassingOutput_ShouldSetPropertiesBeforeCallingIt()
{
string passedMessage = null;
var expected = "Log test!";
var stub = new StubIOutput()
{
WriteLogEntry = (entry) =>
{
passedMessage = entry.Message;
}
};
var l = new LogEntry(expected, stub);
Assert.AreEqual(expected, passedMessage,
"Message property should be setted before calling output");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment