private static void AreObjectsEqual(TableModel a, ITableInformationViewModel b)
 {
     Assert.AreEqual(a.DisplayName, b.Name);
     Assert.AreEqual(a.ObjectType, b.ObjectType);
     for (var i = 0; i < a.Columns.Count(); i++)
     {
         Assert.AreEqual(a.Columns.ElementAt(i).Name, b.Columns.ElementAt(i).Name);
     }
 }
Exemplo n.º 2
0
        private static void PredefineSelection(ITableInformationViewModel t)
        {
            var unSelect = t.Name.StartsWith("[__") ||
                           t.Name.StartsWith("[dbo].[__") ||
                           t.Name.EndsWith(".[sysdiagrams]");

            if (unSelect)
            {
                t.IsSelected = false;
            }
        }
        private static ITableInformationViewModel[] GetTestViewModels()
        {
            var r = new ITableInformationViewModel[6];

            r[0] = new TableInformationViewModel
            {
                IsSelected = false,
                Model      = new TableInformationModel("[dbo].[Atlas]", true)
            };
            r[1] = new TableInformationViewModel
            {
                IsSelected = true,
                Model      = new TableInformationModel("[__].[RefactorLog]", false)
            };
            r[2] = new TableInformationViewModel
            {
                IsSelected = true,
                Model      = new TableInformationModel("[dbo].[__RefactorLog]", true)
            };
            r[3] = new TableInformationViewModel
            {
                IsSelected = true,
                Model      = new TableInformationModel("[dbo].[sysdiagrams]", true)
            };
            r[4] = new TableInformationViewModel
            {
                IsSelected = true,
                Model      = new TableInformationModel("unit.test", true)
            };
            r[5] = new TableInformationViewModel
            {
                IsSelected = true,
                Model      = new TableInformationModel("unit.foo", false)
            };

            return(r);
        }
Exemplo n.º 4
0
        private static ITableInformationViewModel[] GetTestViewModels()
        {
            var r = new ITableInformationViewModel[6];

            r[0] = new TableInformationViewModel
            {
                IsSelected    = false,
                HasPrimaryKey = true,
                Name          = "[dbo].[Atlas]",
            };
            r[0].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "Id"
            });
            r[0].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column1"
            });
            r[0].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column2"
            });

            r[1] = new TableInformationViewModel
            {
                IsSelected    = true,
                HasPrimaryKey = true,
                Name          = "[__].[RefactorLog]",
            };
            r[1].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "Id"
            });
            r[1].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column1"
            });
            r[1].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column2"
            });

            r[2] = new TableInformationViewModel
            {
                IsSelected    = true,
                HasPrimaryKey = true,
                Name          = "[dbo].[__RefactorLog]",
            };
            r[2].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "Id"
            });
            r[2].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column1"
            });
            r[2].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column2"
            });

            r[3] = new TableInformationViewModel
            {
                IsSelected    = true,
                HasPrimaryKey = true,
                Name          = "[dbo].[sysdiagrams]",
            };
            r[3].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "Id"
            });
            r[3].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column1"
            });
            r[3].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column2"
            });

            r[4] = new TableInformationViewModel
            {
                IsSelected    = true,
                HasPrimaryKey = true,
                Name          = "unit.test",
            };
            r[4].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "Id"
            });
            r[4].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column1"
            });
            r[4].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column2"
            });

            r[5] = new TableInformationViewModel
            {
                IsSelected    = true,
                HasPrimaryKey = true,
                Name          = "unit.foo",
            };
            r[5].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "Id"
            });
            r[5].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column1"
            });
            r[5].Columns.Add(new ColumnInformationViewModel
            {
                IsSelected = true,
                Name       = "column2"
            });

            return(r);
        }