Last active
June 13, 2018 11:02
-
-
Save efleming969/c3533416563221612047e1f3d965f548 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 System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Moq; | |
[TestClass] | |
public class StubbingTests | |
{ | |
[TestMethod] | |
public void should_build_a_greeting_based_on_age() | |
{ | |
var stubMessageService = new Mock<IMessageService>(); | |
stubMessageService.Setup(ds => ds.GetMessageBasedOnAge(45)).Returns("Whazzup"); | |
GreetingBuilder2 sut = new GreetingBuilder2(stubMessageService.Object); | |
string result = sut.Build("Joe", 45); | |
Assert.AreEqual("Whazzup, Joe!", result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment