public PatternCompilerTests() { var services = new ServiceCollection().AddUrlPattern(); var serviceProvider = services.BuildServiceProvider(); compiler = serviceProvider.GetRequiredService <IPatternCompiler>(); }
// This constructor is used by the dependency injection engine public PatternEngine(IPatternCompiler compiler, IPatternMatcher matcher) { this.compiler = CheckValue(compiler, nameof(compiler)); this.matcher = CheckValue(matcher, nameof(matcher)); }
public PatternEngine() { compiler = new PatternCompiler(new PatternTypeResolver(), new PatternParser(), new PatternValidator()); matcher = new PatternMatcher(); }