Skip to content

Instantly share code, notes, and snippets.

@jmarnold
Created May 11, 2012 18:47
Show Gist options
  • Save jmarnold/2661646 to your computer and use it in GitHub Desktop.
Save jmarnold/2661646 to your computer and use it in GitHub Desktop.
Yup
[TestFixture]
public class showing_you_my_junk
{
private ISomething theSomethingA;
private ISomething theSomethingB;
private SomethingElse theClassUnderTest;
[SetUp]
public void SetUp()
{
theSomethingA = MockRepository.GenerateStub<ISomething>();
theSomethingB = MockRepository.GenerateStub<ISomething>();
theClassUnderTest = new SomethingElse(new [] { theSomethingA, theSomethingB });
}
[Test]
public void look_at_these()
{
var someObject = Guid.New();
theSomethingA.Stub(x => x.Matches()).Returns(true);
theSomethingA.Stub(x => x.BuildIt()).Returns(someObject);
theClassUnderTest.UseTheImplementations().ShouldEqual(someObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment