System.Data.Tests.MissingPrimaryKeyExceptionTest.Generate2 C# (CSharp) Method

Generate2() private method

private Generate2 ( ) : void
return void
        public void Generate2()
        {
            DataTable tbl = DataProvider.CreateParentDataTable();
            //can't invoke Contains method with no primary key

            Assert.Throws<MissingPrimaryKeyException>(() => tbl.Rows.Contains("Something"));
        }
    }
MissingPrimaryKeyExceptionTest