I am developing an ASP.NET MVC application. The application runs perfectly. I can view, add, update and delete records, but when I run the unit tests, it shows an error on every test method.
The error is:
The underlying provider failed on Open.
Error details:
{"Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=21013; handshake=0; "}
What can be issue?
Unit Test Code
[TestMethod]
public void Test_Company_GetCompanyType()
{
controllerBuilder.Session["loggedEmpId"] = 6;
companyId = 66;
//Case 1 : Does Company have Type or not ?
JsonResult actualCompanyType = oCompanyController.GetCompanyType(companyId) as JsonResult;
var result = actualCompanyType.Data;
Assert.IsNull(result,"Company have types");
}