CsDO.Tests.TesteObj.GetPrimaryKeys C# (CSharp) Method

GetPrimaryKeys() public method

public GetPrimaryKeys ( ) : IList
return IList
        public IList GetPrimaryKeys()
        {
            return PrimaryKeys;
        }

Usage Example

示例#1
0
        public void PrimaryKey()
        {
            TesteObj obj = new TesteObj();

            Assert.IsNotNull(obj.GetPrimaryKeys(), "PrimaryKey is null");
            Assert.AreEqual(1, obj.GetPrimaryKeys().Count, "PrimaryKey size is not 1");
            Assert.AreEqual("ID", ((PropertyInfo) obj.GetPrimaryKeys()[0]).Name, "PrimaryKey not found");
            Assert.AreEqual("Cod", ((Column)((PropertyInfo) obj.GetPrimaryKeys()[0]).GetCustomAttributes(typeof(Column), true)[0]).Name, "PrimaryKey properties not found");
        }