Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.






Browse by Tags

All Tags » Testing (RSS)
Using database unit tests in Visual Studio
Stored procedures in SQL Server database can be unit tested using Visual Studio database unit tests. It may seem as simple thing to do at first but when you start writing tests then you will find out it’s more complex task to do then expected. In this...
Using Moq to mock ASP.NET MVC HttpContextBase
Here’s my little example about how to use Moq to mock HttpContextBase and it’s members to make controller tests pass. You can use this code when you are not allowed to use open-source or use-on-your-own-risk pieces of software that provide you this kind...
Posted: Jul 16 2011, 12:52 PM by DigiMortal | with 5 comment(s)
Filed under: , ,
Quick introduction to Pex
Pex and Moles is new testing and code analysis technology that is created by Microsoft Research. Pex is powerful tool that helps you analyze your code, detect error situations and generate parameterized unit tests. In this posting I will give you quick...
ASP.NET MVC 3: Using HttpNotFoundResult in controller tests
Lately I blogged about HttpNotFoundResult and HttpStatusCodeResult action results that come with ASP.NET MVC 3. These results are ideal for controller tests as we don’t have to mess with HttpContext and Response objects anymore. In this posting I will...
Posted: Aug 15 2010, 07:46 PM by DigiMortal | with 7 comment(s)
Filed under: , ,
ASP.NET MVC: Using dynamic type to test controller actions returning JsonResult
I wrote unit tests for my ASP.NET MVC application that uses some jQuery AJAX-components. These components load data from server in JSON format . I needed to write tests for these methods to make sure that correct data is returned to client. In this posting...
Code Contracts: Unit testing contracted code
Code contracts and unit tests are not replacements for each other. They both have different purpose and different nature. It does not matter if you are using code contracts or not – you still have to write tests for your code. In this posting I will show...
ExpectedException attribute in Visual Studio 2008 and Visual Studio 2010
Today I tried to write my first unit tests under Visual Studio 2010 . Just to see if Visual Studio testing system can now also be used for unit tests. Visual Studio 2008 had some annoying problems with test and I preferred to use nUnit instead. Visual...
Free Typemock licenses
Guys from Typemock are giving away some free licenses. The text below is taken from their web site. I hope I get some licenses too. :) Unit Testing ASP.NET? ASP.NET unit testing has never been this easy. Typemock is launching a new product for ASP.NET...
More Posts