public void Facade__Can_return_constant_result_no_matter_what()
        {
            IConvention <string, string> testing = BuildRoutine.Convention <string, string>().Constant("constant_result");

            Assert.AreEqual("constant_result", testing.Apply("test1"));
            Assert.AreEqual("constant_result", testing.Apply("test2"));
        }
 protected override IConvention <IType, IValueExtractor> CreateConventionByDelegate(Func <object, string> extractorDelegate) =>
 BuildRoutine.Convention <IType, IValueExtractor>().Value(e => e.By(extractorDelegate));
 protected override IConvention <IType, IValueExtractor> CreateConventionByPublicMethod(Func <IMethod, bool> filter, Func <PropertyValueExtractor, PropertyValueExtractor> configurationDelegate) =>
 BuildRoutine.Convention <IType, IValueExtractor>().ValueByPublicMethod(filter, configurationDelegate);
示例#4
0
 public static TConfiguration Add <TConfiguration, TFrom, TItem>(
     this ConventionBasedListConfiguration <TConfiguration, TFrom, TItem> source,
     Func <ConventionBuilder <TFrom, List <TItem> >, IConvention <TFrom, List <TItem> > > conventionDelegate
     ) where TConfiguration : ILayered =>
 source.Add(conventionDelegate(BuildRoutine.Convention <TFrom, List <TItem> >()));
示例#5
0
 public static TConfiguration Set <TConfiguration, TFrom, TResult>(
     this ConventionBasedConfiguration <TConfiguration, TFrom, TResult> source,
     Func <ConventionBuilder <TFrom, TResult>, IConvention <TFrom, TResult> > conventionDelegate
     ) where TConfiguration : ILayered =>
 source.Set(conventionDelegate(BuildRoutine.Convention <TFrom, TResult>()));