Created
August 23, 2012 01:24
-
-
Save ElemarJR/3431083 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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