Beispiel #1
0
        public void Test23DecodeJsonToEfDataCheckFirstTableRelationshipsOk()
        {
            //SETUP

            //EXECUTE
            var efData = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");

            //VERIFY
            efData[0].RelationshipCols.Count.ShouldEqual(0);
        }
Beispiel #2
0
        public void Test05DecodeJsonToSqlDataCheckForeignKeysOk()
        {
            //SETUP

            //EXECUTE
            var sqlData = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //VERIFY
            sqlData.ForeignKeys.Count.ShouldEqual(1);
            sqlData.ForeignKeys[0].ToString().ShouldEqual("Parent: DataChild.DataTopId, Referenced: DataTop.DataTopId");
        }
Beispiel #3
0
        public void Test26DecodeJsonToEfDataCheckSecondTableRelationshipsOk()
        {
            //SETUP

            //EXECUTE
            var efData = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");

            //VERIFY
            efData[1].RelationshipCols.Count.ShouldEqual(1);
            efData[1].RelationshipCols[0].ToString().ShouldEqual("ClrColumnName: Parent, ClrColumnType: EfPocoClasses.Relationships.DataTop, FromToRelationships: Many-to-One");
        }
Beispiel #4
0
        public void Test22DecodeJsonToEfDataCheckFirstTableColumnsOk()
        {
            //SETUP

            //EXECUTE
            var efData = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");

            //VERIFY
            efData[0].NormalCols.Count.ShouldEqual(2);
            efData[0].NormalCols[0].ToString().ShouldEqual("SqlColumnName: DataTopId, SqlTypeName: int, ClrColumName: DataTopId, ClrColumnType: System.Int32, IsPrimaryKey: True, PrimaryKeyOrder: 1, IsNullable: False, MaxLength: 4");
            efData[0].NormalCols[1].ToString().ShouldEqual("SqlColumnName: MyBool, SqlTypeName: bit, ClrColumName: MyBool, ClrColumnType: System.Boolean, IsPrimaryKey: False, PrimaryKeyOrder: 0, IsNullable: False, MaxLength: 1");
        }
Beispiel #5
0
        public void Test02DecodeJsonToSqlDataCheckTablesOk()
        {
            //SETUP

            //EXECUTE
            var sqlData = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //VERIFY
            sqlData.TableInfos.Count.ShouldEqual(2);
            sqlData.TableInfos[0].ToString().ShouldEqual("Name: dbo.DataTop, Columns: 2");
            sqlData.TableInfos[1].ToString().ShouldEqual("Name: dbo.DataChild, Columns: 3");
        }
Beispiel #6
0
        public void Test01DecodeJsonToSqlDataCheckTopLayerOk()
        {
            //SETUP

            //EXECUTE
            var sqlData = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //VERIFY
            sqlData.TableInfos.Count.ShouldEqual(2);
            sqlData.ForeignKeys.Count.ShouldEqual(1);
            sqlData.Indexes.Count.ShouldEqual(3);
        }
        public void Test01CompareSameMockDataOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData, sqlData);

            //VERIFY
            status.ShouldBeValid();
        }
Beispiel #8
0
        public void Test21DecodeJsonToEfDataCheckTopLayerOk()
        {
            //SETUP

            //EXECUTE
            var efData = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");

            //VERIFY
            efData.Count.ShouldEqual(2);
            efData[0].ToString().ShouldEqual("Name: dbo.DataTop, NormalCols: 2, Relationships: 0");
            efData[1].ToString().ShouldEqual("Name: dbo.DataChild, NormalCols: 3, Relationships: 1");
        }
Beispiel #9
0
        public void Test06DecodeJsonToSqlDataCheckIndexesOk()
        {
            //SETUP

            //EXECUTE
            var sqlData = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //VERIFY
            sqlData.Indexes.Count.ShouldEqual(3);
            sqlData.Indexes[0].ToString().ShouldEqual("[dbo].[DataChild].DataTopId: (not primary key, not clustered, not unique)");
            sqlData.Indexes[1].ToString().ShouldEqual("[dbo].[DataChild].DataChildId: (primary key, clustered, unique)");
            sqlData.Indexes[2].ToString().ShouldEqual("[dbo].[DataTop].DataTopId: (primary key, clustered, unique)");
        }
Beispiel #10
0
        public void Test03DecodeJsonToSqlDataCheckTableDataTopOk()
        {
            //SETUP

            //EXECUTE
            var sqlData = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //VERIFY
            sqlData.TableInfos.Count.ShouldEqual(2);
            sqlData.TableInfos[0].TableName.ShouldEqual("DataTop");
            sqlData.TableInfos[0].ColumnInfos[0].ToString().ShouldEqual("ColumnName: DataTopId, SqlTypeName: int, IsPrimaryKey: True, IsNullable: False, MaxLength: 4");
            sqlData.TableInfos[0].ColumnInfos[1].ToString().ShouldEqual("ColumnName: MyBool, SqlTypeName: bit, IsPrimaryKey: False, IsNullable: False, MaxLength: 1");
        }
Beispiel #11
0
        public void Test25DecodeJsonToEfDataCheckSecondTableColumnsOk()
        {
            //SETUP

            //EXECUTE
            var efData = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");

            //VERIFY
            efData[1].NormalCols.Count.ShouldEqual(3);
            efData[1].NormalCols[0].ToString().ShouldEqual("SqlColumnName: DataChildId, SqlTypeName: int, ClrColumName: DataChildId, ClrColumnType: System.Int32, IsPrimaryKey: True, PrimaryKeyOrder: 1, IsNullable: False, MaxLength: 4");
            efData[1].NormalCols[1].ToString().ShouldEqual("SqlColumnName: MyString, SqlTypeName: varchar, ClrColumName: MyString, ClrColumnType: System.String, IsPrimaryKey: False, PrimaryKeyOrder: 0, IsNullable: True, MaxLength: 25");
            efData[1].NormalCols[2].ToString().ShouldEqual("SqlColumnName: DataTopId, SqlTypeName: int, ClrColumName: DataTopId, ClrColumnType: System.Int32, IsPrimaryKey: False, PrimaryKeyOrder: 0, IsNullable: False, MaxLength: 4");
        }
        public void Test01CompareSameMockDataOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid();
        }
        public void Test17CompareMockDataRemoveColumnInRefOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeObjectWithSingleRemoval <SqlAllInfo>("SqlAllInfo01*.json", "TableInfos", 0, "ColumnInfos", 0);
            var sqlData2 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid();
            string.Join(",", status.Warnings).ShouldEqual("Warning: Extra Column: The 'ToBeCheckUnitTest' database SQL table [dbo].[DataTop] has a column called DataTopId (type int), which database 'RefUnitTest' did not have.", string.Join(",", status.Warnings));
        }
        public void Test16CompareMockDataRemoveColumnInToBeCheckedOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeArrayWithSingleRemoval <List <EfTableInfo> >("EfTableInfos01*.json", 1, "NormalCols", 1);
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid();
            string.Join(",", status.Warnings).ShouldEqual("Warning: SQL SqlRefString table [dbo].[DataChild] has a column called MyString (.NET type System.String) that EF does not access.", string.Join(",", status.Warnings));
        }
        public void Test23CompareMockDataChangeForeignKeyReferencedColNameOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "ReferencedColName");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Foreign key: The 'RefUnitTest' SQL database has a foreign key Parent: DataChild.DataTopId, Referenced: DataTop.DataTopId, which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors());
            string.Join(",", status.Warnings).ShouldEqual("Warning: The 'ToBeCheckUnitTest' database has a foreign key Parent: DataChild.DataTopId, Referenced: DataTop.BadName, which the 'RefUnitTest' database did not have.", string.Join(",", status.Warnings));
        }
        public void Test15CompareMockDataChangeMaxLengthOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeArrayWithSingleAlteration <List <EfTableInfo> >("EfTableInfos01*.json", 2, 0, "NormalCols", 0, "MaxLength");
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("MaxLength: The  SQL SqlRefString  column [dbo].[DataTop].DataTopId, type System.Int32, length does not match EF. SQL length = 4, EF length = 2.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test14CompareMockDataChangeIsNullableOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeArrayWithSingleAlteration <List <EfTableInfo> >("EfTableInfos01*.json", true, 0, "NormalCols", 0, "IsNullable");
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Column Nullable: SQL SqlRefString column [dbo].[DataTop].DataTopId nullablity does not match. SQL is NOT NULL, EF is NULL.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test13CompareMockDataChangePrimaryKeyOrderOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeArrayWithSingleAlteration <List <EfTableInfo> >("EfTableInfos01*.json", 2, 0, "NormalCols", 0, "PrimaryKeyOrder");
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Primary Key Order: The SQL SqlRefString  column [dbo].[DataTop].DataTopId primary key order does not match. SQL order = 1, EF order = 2.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test12CompareMockDataChangePrimaryKeyOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", false, "TableInfos", 0, "ColumnInfos", 0, "IsPrimaryKey");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Primary Key: The SQL column [dbo].[DataTop].DataTopId primary key settings don't match. 'RefUnitTest' db says is a key, 'ToBeCheckUnitTest' db says it is NOT a key.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test11CompareMockDataChangeColumnSqlTypeOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "bit", "TableInfos", 0, "ColumnInfos", 0, "SqlTypeName");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Column Type: SQL column [dbo].[DataTop].DataTopId type does not match EF. 'RefUnitTest' db type = int, 'ToBeCheckUnitTest' db type = bit.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test10CompareMockDataChangeColumnNameOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "BadColName", "TableInfos", 0, "ColumnInfos", 0, "ColumnName");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Column: The SQL table [dbo].[DataTop] in second database does not contain a column called DataTopId.", status.GetAllErrors());
            string.Join(",", status.Warnings).ShouldEqual("Warning: Extra Column: The 'ToBeCheckUnitTest' database SQL table [dbo].[DataTop] has a column called BadColName (type int), which database 'RefUnitTest' did not have.", string.Join(",", status.Warnings));
        }
        public void Test41CompareMockDataChangeIndexRemovePrimaryKeyInSetOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleRemoval <SqlAllInfo>("SqlAllInfo01*.json", "Indexes", 1);

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Index: The 'RefUnitTest' SQL database has an index [dbo].[DataChild].DataChildId: (primary key, clustered, unique), which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test05CompareMockDataChangeTableNameOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "NewDataName", "TableInfos", 0, "TableName");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Table: The 'RefUnitTest' SQL database has a table called [dbo].[DataTop], which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors());
            string.Join(",", status.Warnings).ShouldEqual("Warning: Extra Table: SQL database 'RefUnitTest', table [dbo].[NewDataName] table contained an extra table, [dbo].[NewDataName]", string.Join(",", status.Warnings));
        }
        public void Test35CompareMockDataChangeIndexHasIdentityOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", true, "Indexes", 0, "IsIdentity");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Index Mismatch: The 'RefUnitTest' SQL database, index on [dbo].[DataChild].DataTopId is NOT an identity column, while the index on the same table.column in SQL database ToBeCheckUnitTest is an identity column.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test31CompareMockDataChangeIndexColumnNameOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "BadName", "Indexes", 0, "ColumnName");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Index: The 'RefUnitTest' SQL database has an index [dbo].[DataChild].DataTopId: (not primary key, not clustered, not unique), which is missing in the 'ToBeCheckUnitTest' database.", status.GetAllErrors());
            string.Join(",", status.Warnings).ShouldEqual("Warning: Missing Index: The 'ToBeCheckUnitTest' database has an index [dbo].[DataChild].BadName: (not primary key, not clustered, not unique), which the 'RefUnitTest' database did not have.", string.Join(",", status.Warnings));
        }
        public void Test27CompareMockDataChangeForeignKeyCascadeOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeData <List <EfTableInfo> >("EfTableInfos01*.json");
            var sqlData  = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "CASCADE", "ForeignKeys", 3, "DeleteAction");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Cascade Delete: The ZeroOrOne-to-One relationship between DataSingleton.Parent and DataTop has different cascade delete value. SQL foreign key say CASCADE, EF setting is NO_ACTION.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test10CompareMockDataChangeColumnNameOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeArrayWithSingleAlteration <List <EfTableInfo> >("EfTableInfos01*.json", "BadName", 0, "NormalCols", 0, "SqlColumnName");
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Column: The SQL SqlRefString table [dbo].[DataTop] does not contain a column called BadName. Needed by EF class DataTop.", status.GetAllErrors());
            string.Join(",", status.Warnings).ShouldEqual("Warning: SQL SqlRefString table [dbo].[DataTop] has a column called DataTopId (.NET type System.Int32) that EF does not access.", string.Join(",", status.Warnings));
        }
        public void Test16CompareMockDataRemoveColumnInToBeCheckedOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleRemoval <SqlAllInfo>("SqlAllInfo01*.json", "TableInfos", 0, "ColumnInfos", 0);

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Missing Column: The SQL table [dbo].[DataTop] in second database does not contain a column called DataTopId.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test11CompareMockDataChangeColumnSqlTypeOk()
        {
            //SETUP
            var efData   = LoadJsonHelpers.DeserializeArrayWithSingleAlteration <List <EfTableInfo> >("EfTableInfos01*.json", "varchar", 0, "NormalCols", 0, "SqlTypeName");
            var sqlData  = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var comparer = new EfCompare("SqlRefString", sqlData.TableInfos.ToDictionary(x => x.CombinedName));

            //EXECUTE
            var status = comparer.CompareEfWithSql(efData, sqlData);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Column Type: The SQL SqlRefString column [dbo].[DataTop].DataTopId type does not match EF. SQL type = int, EF type = varchar.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }
        public void Test24CompareMockDataChangeForeignKeyReferencedColNameOk()
        {
            //SETUP
            var comparer = new SqlCompare("RefUnitTest", "ToBeCheckUnitTest", "", true);
            var sqlData1 = LoadJsonHelpers.DeserializeData <SqlAllInfo>("SqlAllInfo01*.json");
            var sqlData2 = LoadJsonHelpers.DeserializeObjectWithSingleAlteration <SqlAllInfo>("SqlAllInfo01*.json", "BadName", "ForeignKeys", 0, "DeleteAction");

            //EXECUTE
            var status = comparer.CompareSqlToSql(sqlData1, sqlData2);

            //VERIFY
            status.ShouldBeValid(false);
            status.GetAllErrors().ShouldEqual("Foreign Key Delete Action: The [RefUnitTest] database has a foreign key Parent: DataChild.DataTopId, Referenced: DataTop.DataTopId that has delete action of CASCADE, while database [ToBeCheckUnitTest] has delete action of BadName.", status.GetAllErrors());
            status.HasWarnings.ShouldEqual(false, string.Join(",", status.Warnings));
        }