public void CheckProviderValidation(DbPlatform platformUnderExecution, DbAltererOptions options, int expectedTotalNumberOfSupportedProviders, int expectedValidationRuns) { // arrange var providerLocator = new ProviderLocator(new ProviderFactory()); int totalNumberOfSupportedProviders = options.SupportedPlatforms.Sum(n => providerLocator.GetAllForMinimumRequirement(n).Count()); var validatorFactory = new ValidatorFactory(providerLocator.GetExactly(platformUnderExecution), options, providerLocator); Validator validator = validatorFactory.Create(); var reporter = A.Fake<IMigrationReporter>(); string errors; string warnings; // act validator.Validate(new[] { reporter }, out errors, out warnings); // assert Assert.AreEqual(expectedTotalNumberOfSupportedProviders, totalNumberOfSupportedProviders, "Wrong total number of providers."); A.CallTo(() => reporter.Report(A<IMigrationContext>._)).MustHaveHappened(Repeated.Exactly.Times(expectedValidationRuns)); }
public Validator(IEnumerable <ProviderInfo> providers, DbAltererOptions options) { _providers = providers; _options = options; }
public ValidatorFactory(ProviderInfo providerInfo, DbAltererOptions options, ProviderLocator providerLocator) { _providerInfo = providerInfo; _options = options; _providerLocator = providerLocator; }
public Validator(IEnumerable<ProviderInfo> providers, DbAltererOptions options) { _providers = providers; _options = options; }