Unit Testing ASP.NET 5 middleware

Standard

This post is about unit testing your middleware components. For testing middleware ASP.NET team introduced a TestHost package, this package contains a TestServer which can create an ASP.NET request processing pipeline and helpers to submit requests to the pipeline as if it is a real read more →

How to unit test async controllers in ASP.NET 5

Standard

In .NET 4.5 Microsoft introduced Async methods, which helps developers write asynchronous code similar to normal code. Instead of returning ActionResult async method returns Task<ActionResult> This post is about various methods which helps to write unit tests. XUnit is used as unit framework. Here is read more →

Continuous Integration with ASP.NET 5, GitHub and Travis CI

Standard

This post is about setting up a simple continuous integration environment for ASP.NET 5 with GitHub and Travis-CI. So when ever someone commits to the source, the build will be triggered. Once the build is succeeds, all the unit tests will be executes. If all read more →

Serializing .NET dictionary

Standard

Recently I had to implement XML Serialization in one of my class, it was deriving from base class, which has a dictionary property and XML Serialization was failing due to that. And here is the code snippet which will help you to serialize a .Net read more →

Test-driven development in Javascript

Standard

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to read more →

Unit testing ASP.NET Web API Controller

Standard

This post is about unit testing Web API controller. As we are using Entity Framework and some Web API related classes, we need to implement dependency injection to unit test Web API controllers. To manage Entity Framework dependency, I am using a simple Repository pattern. read more →