[TestFixture] public class MyClassTest { private Mock<ISomeService> _someServiceMock; [SetUp] public void SetUp() { _someServiceMock = new Mock<ISomeService>(); } [Test] public void SomeMethod_initialCondition_expectedResult() { // Arrange var expected = "hoe";
_someServiceMock .Setup(x => x.SomeServiceMethod(someValue)) .Returns(true); var classUnderTest = new MyClass(_someServiceMock.Object);
// Act var actual = classUnderTest.SomeMethod(..parms);