Tags » NUnit

Register and test per-request services with Autofac

When we develop web application, like ASP.NET applications, we often need to implement a service with some informations related to the user request, such as session/account infos. 305 more words


Registering of the ASP.NET MVC Controllers with Autofac

One of the capabilities of Autofac is the integration with the ASP.NET applications.

ASP.NET MVC is a framework thinked to supports the dependency injection, and so we can use Autofac to register the modules that compose the application, such as the controllers. 275 more words


Watch NUnit tests in .NET Core

In this post I am going to talk about writing unit tests in .NET Core with NUnit and watch them for changes, re-running the test suite again, on the fly. 892 more words

Unit Tests

Unit testing and code coverage for ASP.NET Web API (2/2)

This post continues on Unit testing and code coverage for ASP.NET Web API (1/2).
Much about the topic is inspired from the truly magnificent book “The Clean Coder: A Code of Conduct for Professional Programmers” of Robert C. 3,292 more words

Unit Tests

Unit testing and code coverage for ASP.NET Web API (1/2)

This is the second post in the series on Web API. Topic is TDD and code coverage, so I am going to demonstrate how to unit test your core code, as well as the API code and in the end, how to measure the code coverage you achieved on testing your code base. 2,706 more words


Services lifetime scope with Autofac

Basically when we resolve a component with Autofac, we could register the object instance in the root container; this is not the best practice, because these components will never be disposed as long as the container lives, that normally is the lifetime of the application. 649 more words


Repository pattern with Autofac

The repository pattern is one of the most popular patterns used in the applications architecture.

With Autofac we are able to manage the dependencies and the lifecycle of the repositories in our application. 840 more words