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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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); }
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); }