예제 #1
0
        private void AssertTypesRow(MergeTypes expected, MergeTypes actual, string provider)
        {
            Assert.AreEqual(expected.Id, actual.Id);
            Assert.AreEqual(expected.FieldInt32, actual.FieldInt32);
            Assert.AreEqual(expected.FieldInt64, actual.FieldInt64);
            Assert.AreEqual(expected.FieldBoolean, actual.FieldBoolean);
            AssertString(expected.FieldString, actual.FieldString, provider);
            AssertString(expected.FieldNString, actual.FieldNString, provider);
            AssertChar(expected.FieldChar, actual.FieldChar, provider);
            AssertChar(expected.FieldChar, actual.FieldChar, provider);
            Assert.AreEqual(expected.FieldFloat, actual.FieldFloat);
            Assert.AreEqual(expected.FieldDouble, actual.FieldDouble);
            Assert.AreEqual(expected.FieldDateTime, actual.FieldDateTime);
            Assert.AreEqual(expected.FieldBinary, actual.FieldBinary);
            Assert.AreEqual(expected.FieldGuid, actual.FieldGuid);
            Assert.AreEqual(expected.FieldDecimal, actual.FieldDecimal);
            Assert.AreEqual(expected.FieldDate, actual.FieldDate);
            AssertTime(expected.FieldTime, actual.FieldTime, provider);

            if (expected.FieldEnumString == StringEnum.Value4)
            {
                Assert.IsNull(actual.FieldEnumString);
            }
            else
            {
                Assert.AreEqual(expected.FieldEnumString, actual.FieldEnumString);
            }

            if (expected.FieldEnumNumber == NumberEnum.Value4)
            {
                Assert.IsNull(actual.FieldEnumNumber);
            }
            else
            {
                Assert.AreEqual(expected.FieldEnumNumber, actual.FieldEnumNumber);
            }
        }
예제 #2
0
        private void AssertTypesRow(MergeTypes expected, MergeTypes actual, string provider, bool isIDS)
        {
            Assert.AreEqual(expected.Id, actual.Id);
            Assert.AreEqual(expected.FieldInt32, actual.FieldInt32);

            if (provider != ProviderName.Access)
            {
                Assert.AreEqual(expected.FieldInt64, actual.FieldInt64);
            }

            if (provider != ProviderName.Sybase && provider != ProviderName.SybaseManaged)
            {
                if (provider != ProviderName.Access)
                {
                    Assert.AreEqual(expected.FieldBoolean, actual.FieldBoolean);
                }
                else
                {
                    Assert.AreEqual(expected.FieldBoolean ?? false, actual.FieldBoolean);
                }
            }

            AssertString(expected.FieldString, actual.FieldString, provider, isIDS);
            AssertNString(expected.FieldNString, actual.FieldNString, provider);

            AssertChar(expected.FieldChar, actual.FieldChar, provider);

            AssertNChar(expected.FieldChar, actual.FieldChar, provider);

            Assert.AreEqual(expected.FieldFloat, actual.FieldFloat);

            if (provider != ProviderName.Firebird &&
                provider != TestProvName.Firebird3)
            {
                Assert.AreEqual(expected.FieldDouble, actual.FieldDouble);
            }

            AssertDateTime(expected.FieldDateTime, actual.FieldDateTime, provider);

            AssertDateTimeOffset(expected.FieldDateTime2, actual.FieldDateTime2, provider);

            AssertBinary(expected.FieldBinary, actual.FieldBinary, provider);

            if (!provider.Contains(ProviderName.Informix))
            {
                Assert.AreEqual(expected.FieldGuid, actual.FieldGuid);
            }

            if (!provider.Contains("SQLite"))
            {
                Assert.AreEqual(expected.FieldDecimal, actual.FieldDecimal);
            }

            if (provider != ProviderName.SqlServer2000 &&
                provider != ProviderName.SqlServer2005 &&
                provider != ProviderName.SqlCe &&
                !provider.Contains("Oracle"))
            {
                Assert.AreEqual(expected.FieldDate, actual.FieldDate);
            }

            AssertTime(expected.FieldTime, actual.FieldTime, provider);

            if (expected.FieldEnumString == StringEnum.Value4)
            {
                Assert.IsNull(actual.FieldEnumString);
            }
            else
            {
                Assert.AreEqual(expected.FieldEnumString, actual.FieldEnumString);
            }

            if (expected.FieldEnumNumber == NumberEnum.Value4)
            {
                Assert.IsNull(actual.FieldEnumNumber);
            }
            else
            {
                Assert.AreEqual(expected.FieldEnumNumber, actual.FieldEnumNumber);
            }
        }
예제 #3
0
        private void AssertTypesRow(MergeTypes expected, MergeTypes actual, string context)
        {
            Assert.AreEqual(expected.Id, actual.Id);
            Assert.AreEqual(expected.FieldInt32, actual.FieldInt32);

            if (context != ProviderName.Access)
            {
                Assert.AreEqual(expected.FieldInt64, actual.FieldInt64);
            }

            if (context != ProviderName.Sybase)
            {
                if (context != ProviderName.Access)
                {
                    Assert.AreEqual(expected.FieldBoolean, actual.FieldBoolean);
                }
                else
                {
                    Assert.AreEqual(expected.FieldBoolean ?? false, actual.FieldBoolean);
                }
            }

            AssertString(expected.FieldString, actual.FieldString, context);
            AssertNString(expected.FieldNString, actual.FieldNString, context);

            AssertChar(expected.FieldChar, actual.FieldChar, context);

            AssertNChar(expected.FieldChar, actual.FieldChar, context);

            Assert.AreEqual(expected.FieldFloat, actual.FieldFloat);

            if (context != ProviderName.Firebird &&
                context != TestProvName.Firebird3)
            {
                Assert.AreEqual(expected.FieldDouble, actual.FieldDouble);
            }

            AssertDateTime(expected.FieldDateTime, actual.FieldDateTime, context);

            AssertDateTimeOffset(expected.FieldDateTime2, actual.FieldDateTime2, context);

            AssertBinary(expected.FieldBinary, actual.FieldBinary, context);

            if (context != ProviderName.Informix)
            {
                Assert.AreEqual(expected.FieldGuid, actual.FieldGuid);
            }

            if (context != ProviderName.SQLite)
            {
                Assert.AreEqual(expected.FieldDecimal, actual.FieldDecimal);
            }

            if (context != ProviderName.SqlServer2000 &&
                context != ProviderName.SqlServer2005 &&
                context != ProviderName.SqlCe &&
                context != ProviderName.Oracle &&
                context != ProviderName.OracleManaged &&
                context != ProviderName.OracleNative)
            {
                Assert.AreEqual(expected.FieldDate, actual.FieldDate);
            }

            AssertTime(expected.FieldTime, actual.FieldTime, context);

            if (expected.FieldEnumString == StringEnum.Value4)
            {
                Assert.IsNull(actual.FieldEnumString);
            }
            else
            {
                Assert.AreEqual(expected.FieldEnumString, actual.FieldEnumString);
            }

            if (expected.FieldEnumNumber == NumberEnum.Value4)
            {
                Assert.IsNull(actual.FieldEnumNumber);
            }
            else
            {
                Assert.AreEqual(expected.FieldEnumNumber, actual.FieldEnumNumber);
            }
        }