Last active
June 13, 2018 11:03
-
-
Save efleming969/bb60ef51617b79c827669cc2ae6f7758 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
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Moq; | |
[TestClass] | |
public class MockingTests | |
{ | |
[TestMethod] | |
public void should_send_an_email() | |
{ | |
var mockEmailService = new Mock<IEmailService>(); | |
GreetingBuilder3 sut = new GreetingBuilder3(mockEmailService.Object); | |
sut.Build("[email protected]", "joe"); | |
mockEmailService.Verify(es => es.Send("[email protected]", "hello, joe!")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment