public void TestBTAttribute_RefAttributesNaming() { // Daten einlesen aus Datei ohne Config-Section var fileName = @"..\..\..\..\Test\Data\interface_demo.2.ceusdl"; var data = new ParsableData(System.IO.File.ReadAllText(fileName), fileName); var p = new FileParser(data); var result = p.Parse(); var model = new CoreModel(result); var blModel = new BL.BLModel(model); var btModel = new BTModel(blModel); Assert.AreEqual(3, btModel.Interfaces.Count); Assert.AreEqual("AP", btModel.Config.Prefix); Assert.AreEqual("FH_AP_BaseLayer", btModel.Config.BTDatabase); var btIfa = btModel.Interfaces[0]; Assert.AreEqual("AP_BT_D_Land", btIfa.Name); var btAttr1 = btIfa.Attributes[6]; Assert.IsTrue(btAttr1 is RefBTAttribute); var refAttr = (RefBTAttribute)btAttr1; Assert.AreEqual("Kontinent_KNZ", refAttr.KnzAttribute.Name); Assert.AreEqual("Kontinent_ID", refAttr.IdAttribute.Name); Assert.AreEqual(CoreDataType.VARCHAR, refAttr.KnzAttribute.DataType); Assert.AreEqual(CoreDataType.INT, refAttr.IdAttribute.DataType); Assert.AreEqual("varchar(50)", refAttr.KnzAttribute.SqlDataType); Assert.AreEqual("int", refAttr.IdAttribute.SqlDataType); var btAttr2 = btIfa.Attributes[7]; Assert.IsTrue(btAttr2 is RefBTAttribute); refAttr = (RefBTAttribute)btAttr2; Assert.AreEqual("ExistiertSeit_Semester_KNZ", refAttr.KnzAttribute.Name); Assert.AreEqual("ExistiertSeit_Semester_ID", refAttr.IdAttribute.Name); Assert.AreEqual("Semester_KNZ", refAttr.KnzAttribute.ShortName); Assert.AreEqual("Semester_ID", refAttr.IdAttribute.ShortName); Assert.AreEqual("ExistiertSeit", refAttr.KnzAttribute.Alias); Assert.AreEqual("ExistiertSeit", refAttr.IdAttribute.Alias); }
public void TestBTModel_WithMandantAndHistoryFile2() { // Daten einlesen aus Datei ohne Config-Section var fileName = @"..\..\..\..\Test\Data\interface_demo.6.ceusdl"; var data = new ParsableData(System.IO.File.ReadAllText(fileName), fileName); var p = new FileParser(data); var result = p.Parse(); var model = new CoreModel(result); var blModel = new BL.BLModel(model); var btModel = new BTModel(blModel); Assert.AreEqual(4, btModel.Interfaces.Count); Assert.AreEqual("AP", btModel.Config.Prefix); Assert.AreEqual("FH_AP_BaseLayer", btModel.Config.BLDatabase); Assert.AreEqual("FH_AP_BaseLayer", btModel.Config.BTDatabase); var btIfa = btModel.Interfaces[0]; Assert.AreEqual("Land", btIfa.ShortName); Assert.AreEqual("AP_BT_D_Land", btIfa.Name); Assert.AreEqual("FH_AP_BaseLayer.dbo.AP_BT_D_Land", btIfa.FullName); var btIfaV = btModel.Interfaces[1]; Assert.AreEqual("AP_BT_D_Land_VERSION", btIfaV.Name); var identity = (BaseBTAttribute)btIfaV.Attributes[0]; Assert.AreEqual("Land_VERSION_ID", identity.Name); Assert.IsTrue(identity.IsIdentity); var reference = (RefBTAttribute)btIfaV.Attributes[2]; Assert.AreEqual("Land_ID", reference.IdAttribute.Name); Assert.AreEqual("Land_KNZ", reference.KnzAttribute.Name); Assert.AreEqual("AP_BL_D_Land", reference.ReferencedBLInterface.Name); Assert.AreEqual("AP_BT_D_Land", reference.ReferencedBTInterface.Name); Assert.AreEqual("Land_ID", ((BaseBTAttribute)(reference.ReferencedBTAttribute)).Name); Assert.AreEqual("Land_KNZ", reference.ReferencedBLAttribute.Name); }
public void TestBTModel_WithMandantAndHistoryFile() { // Daten einlesen aus Datei ohne Config-Section var fileName = @"..\..\..\..\Test\Data\interface_demo.5.ceusdl"; var data = new ParsableData(System.IO.File.ReadAllText(fileName), fileName); var p = new FileParser(data); var result = p.Parse(); var model = new CoreModel(result); var blModel = new BL.BLModel(model); var btModel = new BTModel(blModel); Assert.AreEqual(3, btModel.Interfaces.Count); Assert.AreEqual("AP", btModel.Config.Prefix); Assert.AreEqual("FH_AP_BaseLayer", btModel.Config.BLDatabase); Assert.AreEqual("FH_AP_BaseLayer", btModel.Config.BTDatabase); var btIfa = btModel.Interfaces[0]; Assert.AreEqual("Land", btIfa.ShortName); Assert.AreEqual("AP_BT_D_Land", btIfa.Name); Assert.AreEqual("FH_AP_BaseLayer.dbo.AP_BT_D_Land", btIfa.FullName); }
public void TestBTModel_BySimpleFile() { // Daten einlesen aus Datei ohne Config-Section var fileName = @"..\..\..\..\Test\Data\interface_demo.ceusdl"; var data = new ParsableData(System.IO.File.ReadAllText(fileName), fileName); var p = new FileParser(data); var result = p.Parse(); var model = new CoreModel(result); var blModel = new BL.BLModel(model); var btModel = new BTModel(blModel); Assert.AreEqual(1, btModel.Interfaces.Count); Assert.AreEqual(null, btModel.Config.Prefix); Assert.AreEqual(null, btModel.Config.BLDatabase); Assert.AreEqual(null, btModel.Config.BTDatabase); var btIfa = btModel.Interfaces[0]; Assert.AreEqual("Semester", btIfa.ShortName); Assert.AreEqual("BT_D_Semester", btIfa.Name); Assert.AreEqual("dbo.BT_D_Semester", btIfa.FullName); }