Пример #1
0
 public void VerifySuppressWarningCombined()
 {
     var options = new MigrationOptions();
     options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithoutSize);
     options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithSize);
     options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithSizeAndScale);
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 0, 0));
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 0));
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 1));
 }
Пример #2
0
        public void VerifySuppressWarningCombined()
        {
            var options = new MigrationOptions();

            options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithoutSize);
            options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithSize);
            options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithSizeAndScale);
            Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 0, 0));
            Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 0));
            Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 1));
        }
Пример #3
0
 public void VerifySuppressWarningAlways()
 {
     var options = new MigrationOptions();
     options.SuppressWarning(ProviderName, Type, SuppressCondition.Always);
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 0, 0));
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 0));
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 1));
 }
Пример #4
0
 public void VerifySuppressWarningWithSizeAndScale()
 {
     var options = new MigrationOptions();
     options.SuppressWarning(ProviderName, Type, SuppressCondition.WhenSpecifiedWithSizeAndScale);
     Assert.IsFalse(options.IsWarningSuppressed(ProviderName, Type, null, null));
     Assert.IsFalse(options.IsWarningSuppressed(ProviderName, Type, 1, null));
     Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 1));
 }
Пример #5
0
 public void VerifySuppressWarningWithoutSize()
 {
     var options = new MigrationOptions();
     options.SuppressWarning(Platform, Type, SuppressCondition.WhenSpecifiedWithoutSize);
     Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, null, null));
     Assert.IsFalse(options.IsWarningSuppressed(Platform, Type, 1, null));
     Assert.IsFalse(options.IsWarningSuppressed(Platform, Type, 1, 1));
 }
Пример #6
0
 public void VerifySuppressWarningAlways()
 {
     var options = new MigrationOptions();
     options.SuppressWarning(Platform, Type, SuppressCondition.Always);
     Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, null, null));
     Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, 1, null));
     Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, 1, 1));
 }
Пример #7
0
        public void VerifySuppressWarningAlways()
        {
            var options = new MigrationOptions();

            options.SuppressWarning(ProviderName, Type, SuppressCondition.Always);
            Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 0, 0));
            Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 0));
            Assert.IsTrue(options.IsWarningSuppressed(ProviderName, Type, 1, 1));
        }
Пример #8
0
        public void VerifySuppressWarningWithSizeAndScale()
        {
            var options = new MigrationOptions();

            options.SuppressWarning(Platform, Type, SuppressCondition.WhenSpecifiedWithSizeAndScale);
            Assert.IsFalse(options.IsWarningSuppressed(Platform, Type, null, null));
            Assert.IsFalse(options.IsWarningSuppressed(Platform, Type, 1, null));
            Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, 1, 1));
        }
Пример #9
0
        public void VerifySuppressWarningAlways()
        {
            var options = new MigrationOptions();

            options.SuppressWarning(Platform, Type, SuppressCondition.Always);
            Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, null, null));
            Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, 1, null));
            Assert.IsTrue(options.IsWarningSuppressed(Platform, Type, 1, 1));
        }
Пример #10
0
        public void VerifyWarningsForSupportedDataTypesAreReportedUnlessSuppressed()
        {
            MigrationOptions options = GetOptions();

            options.SuppressWarning(ProviderName, DbType.Guid, SuppressCondition.WhenSpecifiedWithoutSize);
            string warnings;
            string errors = GetWarnings(options, out warnings);

            Assert.IsNullOrEmpty(errors);
            Assert.AreEqual(
                string.Format(CultureInfo.CurrentCulture, "Migration '{0}' uses the data type '{1}' which is not fully supported by '{2}': {3}", MigrationName, DbType.String, ProviderName, ProviderStub.WarningMessageWithoutSize),
                warnings);
        }
Пример #11
0
        public void VerifyWarningsForSupportedDataTypesAreReportedUnlessSuppressed()
        {
            IEnumerable <ProviderInfo> providerInfos;
            MigrationOptions           options = GetOptions(out providerInfos);

            options.SuppressWarning(Platform, DbType.Guid, SuppressCondition.WhenSpecifiedWithoutSize);
            string warnings;
            string errors = GetWarnings(providerInfos, options, out warnings);

            Assert.That(errors, Is.Null.Or.Empty);
            Assert.AreEqual(
                string.Format(CultureInfo.CurrentCulture, "Migration '{0}' uses the data type '{1}' which is not fully supported by '{2}': {3}", MigrationName, DbType.String, Platform, ProviderStub.WarningMessageWithoutSize),
                warnings);
        }