Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@JamesBender
Last active December 28, 2015 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesBender/7570202 to your computer and use it in GitHub Desktop.
Save JamesBender/7570202 to your computer and use it in GitHub Desktop.
public interface IMockMe
{
string Foo(int x, int y);
int Bar { get; set; }
}
[TestFixture]
public class StrictAndLooseMocking
{
[Test]
public void LooseMocking()
{
var mockedInterface = Mock.Create<IMockMe>();
Mock.Arrange(() => mockedInterface.Foo(1, 2)).Returns("called!");
var x = mockedInterface.Bar;
Assert.AreEqual(0, x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment