public void withSyntaxeTest2() { // Prepare mock repository MockRepository mocks = new MockRepository(); IDependency dependency = mocks.StrictMock <IDependency>(); IAnotherDependency anotherDependency = mocks.StrictMock <IAnotherDependency>(); object result = null; With.Mocks(mocks).ExpectingInSameOrder(delegate { // Record expectations which must be met in the exact same order Expect.Call(dependency.SomeMethod()).Return(null); anotherDependency.SomeOtherMethod(); }) .Verify(delegate { // Replay and validate interaction ComponentImplementation underTest = new ComponentImplementation(dependency, anotherDependency); result = underTest.TestMethod(); }); // Post-interaction assertions Assert.IsNull(result); }
public DIController(ISingletonService singletonService, IScopedService scopedService, ITransientService transientService, ISingletonService singletonService2, IScopedService scopedService2, ITransientService transientService2, IAnotherDependency anotherDependency, IServiceScopeFactory serviceScopeFactory, TesteConfig testeConfig) { this.singletonService = singletonService; this.scopedService = scopedService; this.transientService = transientService; this.singletonService2 = singletonService2; this.scopedService2 = scopedService2; this.transientService2 = transientService2; this.anotherDependency = anotherDependency; this.serviceScopeFactory = serviceScopeFactory; this.testeConfig = testeConfig; }
public ClassWithDependencies(IDependency dependency, IAnotherDependency anotherDependency) { this.dependency = dependency; this.anotherDependency = anotherDependency; }
public ComponentImplementation(IDependency dependency, IAnotherDependency anotherDependency) { this.Dependency = dependency; this.AnotherDependency = anotherDependency; }
public EstatePartHandler(IOrchardServices services, IAnotherDependency another) { Services = services; Another = another; }
public Primary( IAnotherDependency dependency, IAnotherDependency anotherDependency, NotKnown notKnown ) { Selected = MethodBase.GetCurrentMethod(); }
public StubWithMultipleCtorsAndOptionalParameter(IStubDependency stubDependency, IAnotherDependency anotherDependency = null) { Dependency = stubDependency; AnotherDependency = anotherDependency; }