Visual Studio 2015 Unit Test HTTP localhost -
i'm using visual studio 2015. creating stateful api. because it's using sessions cannot use unit testing directly controller classes validation. need use http calls.
but when running unit test doesn't run project http call doesn't find url http://localhost:54916/api/register
if run project , goto menu running unit tests it's disabled.
when running unit tests how can first run project web/database online?
tests run against real web/database integration-tests rather unit-tests.
for unit-testing i'd mock networking\database out of code in order test pure logic without relying on environment run on.
for integration-tests, id create setup runs before tests begin , create environment tests rely on. of course teardown runs after tests finished execution destroys environment created in setup. *the setup can method special method dedicated attribute (mstest examples) or build action in build\ci.
Comments
Post a Comment