Ejemplo n.º 1
0
            public override void Define()
            {
                TestFact1 fact1 = null;
                TestFact2 fact2 = null;

                When()
                .Match(() => fact1,
                       x => x.IntProperty % 2 == 0)
                .Match(() => fact2,
                       x => x.IntProperty % 2 == 0,
                       x => x.IntProperty % 2 == fact1.IntProperty % 4);

                Then()
                .Do(_ => Nothing());
            }
Ejemplo n.º 2
0
            public override void Define()
            {
                TestFact1 fact1 = null;
                IEnumerable <TestFact2> group = null;

                When()
                .Match(() => fact1,
                       x => x.IntProperty % 2 == 0)
                .Query(() => group, q => q
                       .Match <TestFact2>(
                           x => x.IntProperty % 2 == 0)
                       .Where(x => x.IntProperty % 2 == fact1.IntProperty % 4)
                       .GroupBy(x => x.IntProperty % 10));

                Then()
                .Do(_ => Nothing());
            }
Ejemplo n.º 3
0
        public void Setup()
        {
            SetupRule <TestRule>();

            _facts1 = new TestFact1[Fact1Count];
            for (int i = 0; i < Fact1Count; i++)
            {
                _facts1[i] = new TestFact1 {
                    IntProperty = i
                };
            }

            _facts2 = new TestFact2[Fact2Count];
            for (int i = 0; i < Fact2Count; i++)
            {
                _facts2[i] = new TestFact2 {
                    IntProperty = i
                };
            }
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            var rules = new List <IRuleDefinition>();

            for (int i = 1; i <= RuleCount; i++)
            {
                var rule = BuildRule(i);
                rules.Add(rule);
            }

            var compiler = new RuleCompiler();

            Factory = compiler.Compile(rules);

            _facts1 = new TestFact1[FactCount];
            for (int i = 0; i < FactCount; i++)
            {
                _facts1[i] = new TestFact1 {
                    IntProperty = i
                };
            }
        }
Ejemplo n.º 5
0
 public static void ExtensionMethod(this TestFact1 fact, int value)
 {
 }
Ejemplo n.º 6
0
 public static void ExtensionMethod(this TestFact1 fact)
 {
 }