public void ResolveServiceAsTransientIfMarkedWithAttribute() { var aggregate = new FakeAggregateWithTransientServiceBehavior(); var handleMethod = HandleByStrategyAttribute.Default.GetHandleMethods(typeof(FakeAggregateWithTransientServiceBehavior), serviceProvider.Object).Single(); handleMethod.Value(aggregate, new FakeCommand()); handleMethod.Value(aggregate, new FakeCommand()); serviceProvider.Verify(mock => mock.GetService(typeof(FakeService)), Times.Exactly(2)); }
public void ResolveServiceAsTransientIfMarkedWithAttribute() { var aggregate = new FakeAggregateWithTransientServiceBehavior(); var handleMethod = HandleByStrategyAttribute.Default.GetHandleMethods(typeof(FakeAggregateWithTransientServiceBehavior), serviceProvider.Object).Single(); handleMethod.Value(aggregate, new FakeCommand()); handleMethod.Value(aggregate, new FakeCommand()); serviceProvider.Verify(mock => mock.GetService(typeof(FakeService)), Times.Exactly(2)); }