Skip to content

Instantly share code, notes, and snippets.

@gideondsouza
Created December 2, 2011 14:47
Show Gist options
  • Save gideondsouza/1423487 to your computer and use it in GitHub Desktop.
Save gideondsouza/1423487 to your computer and use it in GitHub Desktop.
var fakeUserRepo = new Mock<IUserRepository>();
fakeUserRepo.Setup(f => f.GetUserName(It.IsAny<int>)).Returns("FakeUser");
//does the same thing as the class declaration
fakeUserRepo.Object;//this returns fake object of type IUserRepository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment