less than 1 minute read

Daniel Cazzulino just announced the birth of Moq, now this is mocking done right.

 

// ShouldExpectCallWithArgument
var mock = new Mock<IFoo>();

mock
.Expect(x => x.DoInt(1)).Returns(11);
mock
.Expect(x => x.DoInt(2)).Returns(22);

Assert.AreEqual(11, mock.Instance.DoInt(1));
Assert.AreEqual(22, mock.Instance.DoInt(2));

 

Lambda is starting to make my mouth water.

Categories:

Updated: