Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Need help with steps required for creating a Test Harness

$
0
0

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


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>