We have the following unit test on our WebAPI project:
[TestMethod, TestCategory("UnitTests.InternalAPi"), TestCategory("ContainerConfigTests"), TestCategory("ContainerConfigTests.RegisterComponents")]
public void ContainerVerified()
{
// HACK: This isn't really a unit test per se, it's testing components that we're not directly interested in.
// However, it exists to provide an early warning that the container config would fail at runtime.
var container = new Container();
ContainerConfig.RegisterApplicationComponents(container);
container.Verify();
Assert.IsTrue(true); // An Exception will be thrown if the container does not verify correctly.
}
The purpose of this test, is that it performs the DI registrations that the API does (or all the classes we created, at least - it skips the Controller registrations, etc), then verifies that everything works correctly.
If a registration is missing, this test will fail as expected on the local VS instance (it throws an exception, causing the test to fail). However, it doesn't fail on the server.
The output from the TestResult file on TFS indicates that this test did run, and that it passed.
What could be causing this issue?
Aucun commentaire:
Enregistrer un commentaire