예제 #1
0
        public static async Task <WrappedConventionResult> AndMustConformTo(this Task <WrappedConventionResult> results, IAsyncConventionSpecification conventionSpecification)
        {
            // TODO: Create an AsyncWrappedConventionResult that can store tasks as first-class citizens.
            var previousResults = await results;

            return(Conformist.EnforceConformance(new WrappedConventionResult(
                                                     previousResults.Types,
                                                     previousResults.Results.Union(await Task.WhenAll(previousResults.Types.Select(conventionSpecification.IsSatisfiedBy))))));
        }
예제 #2
0
 public static async Task <ConventionResult> MustConformTo(this Type type, IAsyncConventionSpecification conventionSpecification)
 {
     return(Conformist.EnforceConformance(
                await conventionSpecification.IsSatisfiedBy(type)));
 }
예제 #3
0
 public static async Task <WrappedConventionResult> MustConformTo(this IEnumerable <Type> types, IAsyncConventionSpecification conventionSpecification)
 {
     return(Conformist.EnforceConformance(new WrappedConventionResult(
                                              types,
                                              await Task.WhenAll(types.Select(conventionSpecification.IsSatisfiedBy)))));
 }
예제 #4
0
 public static ConventionResult MustConformTo(ISolutionConventionSpecification solutionConventionSpecification)
 {
     return(Conformist.EnforceConformance(
                solutionConventionSpecification.IsSatisfiedBy(KnownPaths.SolutionRoot)));
 }