I really have no experience with unit testing, but I have tried to implement a very simple one into my application and can't get it to run. I have a .NET Web API with a controller I would like to test. I have crated the following test class in a separate project, and referenced the API in it:
[TestClass]
class TestWebhookControllers
{
[TestMethod]
public void TestTest_ShouldReturn201()
{
var controller = new TestWebhookController();
controller.Request = new HttpRequestMessage();
controller.Configuration = new HttpConfiguration();
var result = controller.Get();
Assert.AreEqual(result.StatusCode, HttpStatusCode.Continue);
}
}
When I click on run all tests, the build succeeds but nothing else happens. The Test Explorer is empty. There are no errors of any kind. I must be missing something basic.