Exemplo n.º 1
0
        private static void PredicateExample()
        {
            var exampleClass = new ExampleClass();
            var dateTester = new DateTester();
            var predicate = new TodayIsAnEvenDayOfTheMonthPredicate(dateTester);

            var component = new PredicatedComponent(exampleClass, predicate);

            component.Something();

            Console.ReadKey();
        }
Exemplo n.º 2
0
        private static void BranchedPredicateExample()
        {
            var trueClass = new TrueClass();
            var falseClass = new FalseClass();

            var dateTester = new DateTester();
            var predicate = new TodayIsAnEvenDayOfTheMonthPredicate(dateTester);

            var component = new BranchedComponent(trueClass, falseClass, predicate);

            component.Something();

            Console.ReadKey();
        }