How do I test wildcard domain logic
Here is an interesting problem... I have configured wildcard domains on my production site and will be using it as a customer identifier. This allows me to display the right banner/css/logos for each customer simply be pulling out the wildcard prefix (eg. CompanyABC.website.com will be displayed the logos and b开发者_JAVA百科randing related to CompanyABC).
But how do I test this on my local Visual Studio 2010 installation? In production the site loads COMPANY.website.com etc., but locally I can only use the flat http://localhost address.
Hosts file?
127.0.0.1 companyabc.website.local
Put the relevant code in a separate class and create a unit test for it.
Just get one more computer. I would prefer one more laptop. Make the IP dynamic and test it there. Results would give higher and accurate results, since your not testing different IPs on the same computer.
精彩评论