I'm new to using NUnit and have written a test to check for the existence of a database table. I have the below code that should check whether a new table named NewTable has been created in the database. It works correctly but I can't help feeling there's probably a better way of doing this. Thanks.
using(var conn = context.NewConnection()) {
var tables = conn.GetSchema("Tables");
foreach(System.Data.DataRow row in tables.Rows) {
foreach(System.Data.DataColumn col in result.Columns) {
if(row[col.ColumnName].ToString() == "NewTable")
Assert.Pass();
}
}
}
Assert.Fail("NewTable not created");