I need to unit test the class below.
What steps would I need to take to get the class into a test harness? and
what would be a few tests I could write ?
publicclassMyDatabase
{
private System.Data.SqlClient.SqlConnection myConn;
staticstring connString ="a valid connection string";
public MyDatabase()
{
myConn =new System.Data.SqlClient.SqlConnection(connString);
}
publicbool Connected
{
get { return (myConn.State ==ConnectionState.Open); }
}
publicvoid Connect()
{
myConn.Open();
}
publicvoid Disconnect()
{
myConn.Close();
}
}
Thanks