System.Data.Tests.DataTableTest.PrimaryKey_CheckSetsAllowDBNull C# (CSharp) Метод

PrimaryKey_CheckSetsAllowDBNull() приватный Метод

private PrimaryKey_CheckSetsAllowDBNull ( ) : void
Результат void
        public void PrimaryKey_CheckSetsAllowDBNull()
        {
            DataTable table = new DataTable();
            DataColumn col1 = table.Columns.Add("col1", typeof(int));
            DataColumn col2 = table.Columns.Add("col2", typeof(int));

            Assert.True(col1.AllowDBNull);
            Assert.True(col2.AllowDBNull);
            Assert.False(col2.Unique);
            Assert.False(col2.Unique);

            table.PrimaryKey = new DataColumn[] { col1, col2 };
            Assert.False(col1.AllowDBNull);
            Assert.False(col2.AllowDBNull);
            Assert.False(col1.Unique);
            Assert.False(col2.Unique);
        }
DataTableTest