Contents tagged with Unit Testing
-
Unit Testing the HttpContext in Controllers
When it comes to unit testing, it is common to use mocking to replace “external” services, that is, those that are not part of the subject under test. Not everything can be mocked, and, sometimes, when we instantiate non-POCO classes, such as controllers (ControllerBase), there are lots of things that are not instantiated by the framework and are left for us do to. Just think, for example, if you want to access request or quest string data or know if the user is logged in?
-
User Interface Unit Tests with .NET Core
In a previous post I talked about doing unit tests with .NET Core. What I didn’t cover was unit testing for the user interface (UI). It is actually something quite common, and we will see how we can do it now.
-
Unit Testing .NET Core
With the recent arrival of .NET Core, some things that we were used to having are no longer available. This includes unit tests – plus Visual Studio integration - and mocking frameworks. Fortunately, they are now becoming available, even if, in some cases, in pre-release form.
-
Unit Testing Asp.NET Applications with with Moles and Pex
It has been a while since my last post. I will try to recover, there are some things I would like to talk about. For now, check out this fine tutorial for unit testing ASP.NET applications using Pex and Moles: http://research.microsoft.com/en-us/projects/pex/molesaspnet.pdf.