public void Test_GetAllOpportunity() { //Initialize SqlQueryHelper object var sqlConnection = new SqlConnection(ConnectionString); sqlConnection.Open(); var command = new SqlCommand("select count(*) from opportunity", sqlConnection); var oppCount = Convert.ToInt32(command.ExecuteScalar()); //Opportunity Opportunity opp = new Opportunity(); List <Opportunity> oppList = opp.GetAllOpportunities(); Assert.AreEqual(oppCount, oppList.Count); }