public void Generate2() { DataTable tbl = DataProvider.CreateParentDataTable(); //can't invoke Contains method with no primary key Assert.Throws<MissingPrimaryKeyException>(() => tbl.Rows.Contains("Something")); } }