Adding some verifications for static file serving.

This commit is contained in:
Praburaj 2014-07-03 13:51:49 -07:00
parent 047db6d5f4
commit 3fdb2e3e57
1 changed files with 16 additions and 0 deletions

View File

@ -54,6 +54,9 @@ namespace E2ETests
Console.WriteLine("[Time]: Approximate time taken for application initialization : '{0}' seconds", (initializationCompleteTime - testStartTime).TotalSeconds);
VerifyHomePage(response, responseContent);
//Verify the static file middleware can serve static content
VerifyStaticContentServed();
//Making a request to a protected resource should automatically redirect to login page
AccessStoreWithoutPermissions();
@ -141,6 +144,19 @@ namespace E2ETests
}
}
private void VerifyStaticContentServed()
{
Console.WriteLine("Validating if static contents are served..");
Console.WriteLine("Fetching favicon.ico..");
var response = httpClient.GetAsync("/favicon.ico").Result;
ThrowIfResponseStatusNotOk(response);
Console.WriteLine("Fetching /Content/bootstrap.css..");
response = httpClient.GetAsync("/Content/bootstrap.css").Result;
ThrowIfResponseStatusNotOk(response);
Console.WriteLine("Verified static contents are served successfully");
}
private void VerifyHomePage(HttpResponseMessage response, string responseContent)
{
Console.WriteLine("Home page content : {0}", responseContent);