I have a WCF application in VS2012. We have also added a testing project for doing unit tests. This is all working well
In addition to this, I need to add another test project for doing system tests, the idea here is that the web service would start, and the test project would fire Http Requests, as kind of an end to end test of the service in the environment it is in.
I am not sure if there is actually a way of doing this using the built in visual studio tests. If I add a normal test class, the website that runs the web service doesn't get started, and the test fails.
The code I am trying to run is like:
[TestMethod]
public void CreateLogin()
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:61886/");
HttpResponseMessage response =
client.GetAsync("ssoauthenticationservice/createssologin").Result;
}
I feel like I am missing something very obvious here. So my questions are:
1) Can I test my web service in this manner - is there some way that I can set the project properties so the web service starts first, then the test project runs
or:
2) Is this approach completely wrong, and what I should really be doing is putting my tests into an executable that I can just run in whatever environment we deploy to as a quick post-deployment smoke test.