public void CopyWithNameAndCategoryPath_Fail() { var tableName = RandomUtility.NextIdentifier(); var categoryPath = RandomUtility.NextCategoryPath(); this.table.Copy(tableName, categoryPath); }
public void NewWithNullNameAndType() { var categoryPath = RandomUtility.NextCategoryPath(); var type = new CremaDataType(null, categoryPath); Assert.AreEqual(string.Empty, type.TypeName); Assert.AreEqual(categoryPath, type.CategoryPath); Assert.AreEqual(CremaSchema.TypeNamespace + type.CategoryPath + type.TypeName, type.Namespace); }
public void CreateWithNameAndCategoryPath() { var dataTable = new CremaDataTable(RandomUtility.NextIdentifier(), RandomUtility.NextCategoryPath(1)); Assert.AreNotEqual(string.Empty, dataTable.Name); Assert.AreNotEqual(string.Empty, dataTable.TableName); Assert.AreEqual(string.Empty, dataTable.TemplateNamespace); Assert.AreNotEqual(PathUtility.Separator, dataTable.CategoryPath); Assert.AreEqual(CremaSchema.TableNamespace + dataTable.CategoryPath + dataTable.TableName, dataTable.Namespace); }
public void NewWithNameAndCategoryPath() { var typeName = RandomUtility.NextIdentifier(); var categoryPath = RandomUtility.NextCategoryPath(); var type = new CremaDataType(typeName, categoryPath); Assert.AreEqual(typeName, type.TypeName); Assert.AreEqual(categoryPath, type.CategoryPath); Assert.AreEqual(CremaSchema.TypeNamespace + type.CategoryPath + type.TypeName, type.Namespace); }
public void Change_CategoryTest() { var dataSet = CremaDataSetExtensions.CreateRandomSet(); var dataTable1 = dataSet.Tables.Random(item => item.TemplatedParent == null && item.Parent == null); var modification = dataTable1.ModificationInfo; Thread.Sleep(1000); dataTable1.CategoryPath = RandomUtility.NextCategoryPath(); Assert.AreEqual(modification, dataTable1.ModificationInfo); }
public void SetCategoryPath() { var categoryPath = RandomUtility.NextCategoryPath(3); var modificationInfo = this.table.ModificationInfo; Thread.Sleep(1000); this.table.CategoryPath = categoryPath; Assert.AreEqual(string.Empty, this.table.TableName); Assert.AreEqual(categoryPath, this.table.CategoryPath); Assert.AreEqual(modificationInfo.DateTime, this.table.ModificationInfo.DateTime); }
public void SetNameAndCategoryPath() { var tableName = RandomUtility.NextIdentifier(); var categoryPath = RandomUtility.NextCategoryPath(); this.table.TableName = tableName; this.table.CategoryPath = categoryPath; Assert.AreEqual(tableName, this.table.TableName); Assert.AreEqual(categoryPath, this.table.CategoryPath); Assert.AreEqual(CremaSchema.TableNamespace + categoryPath + tableName, table.Namespace); }
private void InitializeRandom(bool child) { var tableName = RandomUtility.NextIdentifier(); var categoryPath = RandomUtility.NextCategoryPath(); this.table.TableName = tableName; this.table.CategoryPath = categoryPath; this.table.AddRandomColumns(10); this.table.AddRandomRows(10); if (child == true) { this.table.AddRandomChilds(10); } }
public void ItemNameTest() { var dataSet1 = new CremaDataSet(); var dataType1 = dataSet1.AddRandomType(); var dataSet2 = new CremaDataSet(); var typeName = RandomUtility.NextIdentifier(); var categoryPath = RandomUtility.NextCategoryPath(); dataSet2.ReadTypeString(dataType1.GetXmlSchema(), new ItemName(categoryPath, typeName)); var dataType2 = dataSet2.Types.First(); Assert.AreEqual(typeName, dataType2.Name); Assert.AreEqual(categoryPath, dataType2.CategoryPath); }
public void CopyChildTable() { var dataSet = new CremaDataSet(); var dataTable = dataSet.Tables.Add(); var childTable1 = dataTable.Childs.Add(); var derivedTable = dataTable.Inherit(); derivedTable.CategoryPath = RandomUtility.NextCategoryPath(); var childTable2 = childTable1.Copy(); var derivedChild1 = derivedTable.Childs[childTable1.TableName]; var derivedChild2 = derivedTable.Childs[childTable2.TableName]; Assert.AreEqual(derivedTable.CategoryPath, derivedChild1.CategoryPath); Assert.AreEqual(derivedTable.CategoryPath, derivedChild2.CategoryPath); Assert.AreEqual(dataTable.Childs.Count, derivedTable.Childs.Count); Assert.AreEqual(childTable1.TableName, derivedChild1.TableName); Assert.AreEqual(childTable2.TableName, derivedChild2.TableName); Assert.AreEqual(childTable1.Name, derivedChild1.TemplatedParentName); Assert.AreEqual(childTable2.Name, derivedChild2.TemplatedParentName); }