Exemplo n.º 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))))));
        }
Exemplo n.º 2
0
 public static async Task <ConventionResult> MustConformTo(this Type type, IAsyncConventionSpecification conventionSpecification)
 {
     return(Conformist.EnforceConformance(
                await conventionSpecification.IsSatisfiedBy(type)));
 }
Exemplo n.º 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)))));
 }
Exemplo n.º 4
0
 public static ConventionResult MustConformTo(ISolutionConventionSpecification solutionConventionSpecification)
 {
     return(Conformist.EnforceConformance(
                solutionConventionSpecification.IsSatisfiedBy(KnownPaths.SolutionRoot)));
 }