コード例 #1
0
            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));
            }
コード例 #2
0
 private void SomeAction(FactType fact, ITestService1 service1, ITestService2 service2)
 {
     service1.Action(fact.TestProperty);
     service2.Action(fact.TestProperty);
 }