コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public Validator(IEnumerable <ProviderInfo> providers, DbAltererOptions options)
 {
     _providers = providers;
     _options   = options;
 }
コード例 #4
0
ファイル: ValidatorFactory.cs プロジェクト: dradovic/MigSharp
 public ValidatorFactory(ProviderInfo providerInfo, DbAltererOptions options, ProviderLocator providerLocator)
 {
     _providerInfo = providerInfo;
     _options = options;
     _providerLocator = providerLocator;
 }
コード例 #5
0
 public ValidatorFactory(ProviderInfo providerInfo, DbAltererOptions options, ProviderLocator providerLocator)
 {
     _providerInfo    = providerInfo;
     _options         = options;
     _providerLocator = providerLocator;
 }
コード例 #6
0
ファイル: Validator.cs プロジェクト: dradovic/MigSharp
 public Validator(IEnumerable<ProviderInfo> providers, DbAltererOptions options)
 {
     _providers = providers;
     _options = options;
 }