public void TestCustomBLAttribute_Mandant_Sample2()
        {
            IBLAttribute attr = CustomBLAttribute.GetNewMandantAttribute(null);

            Assert.AreEqual("varchar(10) not null", attr.GetSqlDataTypeDefinition());
            Assert.AreEqual("Mandant_KNZ", attr.Name);
            Assert.AreEqual(10, attr.Length);
            Assert.AreEqual(0, attr.Decimals);
            Assert.AreEqual(CoreDataType.VARCHAR, attr.DataType);
            Assert.IsNull(attr.ParentInterface);
            Assert.IsTrue(attr.IsPartOfUniqueKey);
            Assert.IsFalse(attr.IsIdentity);
            Assert.IsFalse(attr.IsPrimaryKey);
        }
        public void TestCustomBLAttribute_TableID_Sample1()
        {
            IBLInterface parent = new BLInterfaceMock()
            {
                ShortName = "Semester"
            };

            IBLAttribute attr = CustomBLAttribute.GetNewIDAttribute(parent);

            Assert.AreEqual("Semester_ID", attr.Name);
            Assert.AreEqual(0, attr.Length);
            Assert.AreEqual(0, attr.Decimals);
            Assert.AreEqual(CoreDataType.INT, attr.DataType);
            Assert.AreEqual(parent, attr.ParentInterface);
            Assert.IsTrue(attr.IsIdentity);
            Assert.IsTrue(attr.IsPrimaryKey);
            Assert.AreEqual("int primary key identity not null", attr.GetSqlDataTypeDefinition());
        }
        public void TestCustomBLAttribute_TAendDat()
        {
            IBLInterface parent = new BLInterfaceMock()
            {
                ShortName = "Semester"
            };

            IBLAttribute attr = CustomBLAttribute.GetNewTAendDatAttribute(parent);

            Assert.AreEqual("T_Aend_Dat", attr.Name);
            StringAssert.EndsWith(attr.FullName, attr.Name);
            Assert.AreEqual(0, attr.Length);
            Assert.AreEqual(0, attr.Decimals);
            Assert.AreEqual(CoreDataType.DATETIME, attr.DataType);
            Assert.AreEqual(parent, attr.ParentInterface);
            Assert.IsFalse(attr.IsIdentity);
            Assert.IsFalse(attr.IsPrimaryKey);
            Assert.AreEqual("datetime not null", attr.GetSqlDataTypeDefinition());
        }
        public void TestCustomBLAttribute_Mandant_Sample1()
        {
            IBLAttribute attr = new CustomBLAttribute()
            {
                Name            = "Mandant_KNZ",
                FullName        = "Unknown.Mandant_KNZ",
                DataType        = CoreDataType.VARCHAR,
                Length          = 10,
                IsNotNull       = true,
                ParentInterface = null
            };

            Assert.AreEqual("varchar(10) not null", attr.GetSqlDataTypeDefinition());
            Assert.AreEqual("Mandant_KNZ", attr.Name);
            Assert.AreEqual(10, attr.Length);
            Assert.AreEqual(0, attr.Decimals);
            Assert.AreEqual(CoreDataType.VARCHAR, attr.DataType);
            Assert.IsNull(attr.ParentInterface);
        }
        public void TestCustomBLAttribute_TModifikation()
        {
            IBLInterface parent = new BLInterfaceMock()
            {
                ShortName = "Semester"
            };

            IBLAttribute attr = CustomBLAttribute.GetNewTModifikationAttribute(parent);

            Assert.AreEqual("T_Modifikation", attr.Name);
            StringAssert.EndsWith(attr.FullName, attr.Name);
            Assert.AreEqual(10, attr.Length);
            Assert.AreEqual(0, attr.Decimals);
            Assert.AreEqual(CoreDataType.VARCHAR, attr.DataType);
            Assert.AreEqual(parent, attr.ParentInterface);
            Assert.IsFalse(attr.IsIdentity);
            Assert.IsFalse(attr.IsPrimaryKey);
            Assert.IsFalse(attr.IsPartOfUniqueKey);
            Assert.AreEqual("varchar(10) not null", attr.GetSqlDataTypeDefinition());
        }
        public void TestCustomBLAttribute_TLadelaufNR()
        {
            IBLInterface parent = new BLInterfaceMock()
            {
                ShortName = "Semester"
            };

            IBLAttribute attr = CustomBLAttribute.GetNewTLadelaufNRAttribute(parent);

            Assert.AreEqual("T_Ladelauf_NR", attr.Name);
            StringAssert.EndsWith(attr.FullName, attr.Name);
            Assert.AreEqual(0, attr.Length);
            Assert.AreEqual(0, attr.Decimals);
            Assert.AreEqual(CoreDataType.INT, attr.DataType);
            Assert.AreEqual(parent, attr.ParentInterface);
            Assert.IsFalse(attr.IsIdentity);
            Assert.IsFalse(attr.IsPrimaryKey);
            Assert.IsFalse(attr.IsPartOfUniqueKey);
            Assert.AreEqual("int not null", attr.GetSqlDataTypeDefinition());
        }
Example #7
0
 public BaseBTAttribute(CustomBLAttribute blAttribute, BTInterface ifa)
 {
     this.blAttribute     = blAttribute;
     this.ParentInterface = ifa;
     SetName();
 }