You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebApi Project by default use GlobalConfiguration.Configure( WebApiConfig.Register ). The following example shows how to register routes in unit tests file.
private HttpConfiguration _config;
[SetUp]
public void BeforeEach()
{
_config = new HttpConfiguration();
WebApiConfig.Register( _config );
_config.EnsureInitialized(); // we need to call this method after all other initialization code.
}
The problem that your framework is using RouteTable to check routes. If I register routes in second way then RouteTable would be empty and route tests also would fails.
Could you please provide some link or explanation how to register WebApi routes without moving code into RouteTable.Routes method?
I'm not sure that you understand me so please ask a questions if you want.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Probably this topic was described before but I could not find a solution.
There are two ways to registrate routes in MVC and WebApi projects:
The problem that your framework is using RouteTable to check routes. If I register routes in second way then RouteTable would be empty and route tests also would fails.
Could you please provide some link or explanation how to register WebApi routes without moving code into RouteTable.Routes method?
I'm not sure that you understand me so please ask a questions if you want.
Thanks in advance!
The text was updated successfully, but these errors were encountered: