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(); }
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(); }