Closed willapp closed 9 years ago
Just to be clear I'd only like the following commit to be considered for the pull request: https://github.com/willapp/MvcLocalizedRouteTester/commit/c1ce406cf83ca445a07c11e5261be54ebf1cd71b
The further commits were just to allow me to publish a temporary package to NuGet so I can include the modifications in our CI build process.
I think that I can pull that commit in, but not not merging this whole PR with the different nuspec etc. I will try to get another official nuget package out soon.
Hi Anthony,
Yes sorry as I've said it's only the first commit. I'm still a bit new to Git/GitHub so I didn't realise it would add the extra commits to the PR - I needed a NuGet package to integrate with our CI builds and wasn't sure how quickly you could merge+release so I went ahead and published my own (temporary) package with the change included.
OK, I have cherry-picked that commit into master
We're currently using this package: https://github.com/Dresel/RouteLocalization to provide localization support for MVC attribute routing. I wanted to be able to add unit-tests to verify the translated routes are added correctly but the current implementation of
MvcRouteTester
doesn't allow you to supply an implementation of IDirectRouteProvider to theMapAttributeRoutesInAssembly(...)
method. As a result the localized routes don't get added so I can't verify them during testing.To address this I've simply updated the
MvcAssemblyReflector
to pick an alternative override ofSystem.Web.Mvc.Routing.AttributeRoutingMapper.MapAttributeRoutes
which allows supply of anIDirectRouteProvider
implementation. Overrides have then been added toWebRouteTestMapper
so I can supply an implementation during unit testing.I think it would be useful to merge this into the main repo and re-issue an updated NuGet package so that others might benefit from the added flexibility.