my6solutions

asp .net, the social web & other distractions

 

Running Apps


PayPal - The safer, easier way to pay online!

Disclaimer

I am in no way affiliated with Microsoft or Google. I am just another developer trying to make a difference. All opinions and observations are usually my own.

Mocking HttpContext in ASP .NET MVC

One of the first few questions that someone starting to write unit tests for ASP .NET MVC would be "How do you mock HttpContext?". The following is done using Moq and creates a fake HttpContext to be passed to the MVC Controller. public static HttpContextBase FakeHttpContext() {     var httpContext = new Mock<HttpContextBase>();     var request = new Mock&... [More]

Categories: ASP .NET | TDD
Permalink | Comments (0) | Post RSSRSS comment feed

Test Driven Development using Moq

Today, I have decided to start writing unit tests and to try a test driven development. Basically, a test driven development is one where the developer starts specifying automated unit tests first before actually starting to code. These unit tests are usually based on code specifications and what code features should be available. For me, hopefully this will lessen the number of breakages from fix... [More]

Categories: ASP .NET | TDD
Permalink | Comments (0) | Post RSSRSS comment feed