public override void Define()
            {
                FactType      fact     = null;
                ITestService1 service1 = null;
                ITestService2 service2 = null;

                Dependency()
                .Resolve(() => service1)
                .Resolve(() => service2);

                When()
                .Match <FactType>(() => fact, f => f.TestProperty.StartsWith("Valid"));
                Then()
                .Do(ctx => Action(ctx))
                .Do(ctx => service1.Action(fact.TestProperty))
                .Do(ctx => service2.Action(fact.TestProperty))
                .Do(ctx => SomeAction(fact, service1, service2));
            }
 private void SomeAction(FactType fact, ITestService1 service1, ITestService2 service2)
 {
     service1.Action(fact.TestProperty);
     service2.Action(fact.TestProperty);
 }
Beispiel #3
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger, ITestService1 testService1, ITestService2 testService2)
 {
     _logger       = logger;
     _testService1 = testService1;
     _testService2 = testService2;
 }