So I’m trying to get productive practicing TDD in a ASP.NET webpages project, and launching a server every time I want to run my tests, well it isn’t quite fast.
So I’m trying to find a way to do my testing without the use of the [HostType(“ASP.NET”)] attribute, but there is always some error.
We’re using App_GlobalResources folder for our resource files, and this is one of the problems; when removing the attributes, just keeping the [TestMethod] (using MStest), it can’t find the resources. So I’m !NOTE assuming, that it’s not able to find the resources assembly.
So, has anyone done this before? Any experiences?
And comments saying “why don’t you just convert to MVC”, well it’s just to big an app and to little time. Maybe it’ll happen in a couple of years, maybe more, maybe never.
My experience testing ASP.NET Web apps has been painful (which looks like yours is too!) Resisting MVC Comment
My best advice would be take little steps each time you touch an area to make it more testable. For example, for any bits of code you can pull out to it’s own assembly that you can reference do so.
First candidate would be you resource files. Then your tests could reference that satellite assembly without the “App_” hoops to jump through.