Question

What Im trying to achieve is to write UI tests for my MVC4 web application using Watin. Now I create a Browser object and open on URL localhost:xxxxx.

Problem is that the code running on localhost:xxxx using IIS Express is using production code which I dont want to be doing during test. In test I want for instance my IAuth and IDataProvider implementations to behave differently.

How do you UI test on a mocked instance of your application?

Ideas? :)

Was it helpful?

Solution

Solution was to make a bat file which runs a msbuild command which deploy to my local IIS. This works like a charm.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe C:\Source\...\ProjectName.csproj       /p:DeployOnBuild=true /p:PublishProfile="UnitTest" /p:Platform="Any CPU" /p:OutputPath="C:\inetpub\web" /p:VisualStudioVersion=11.0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top