We need to access different services and data from multiple step definition classes. Shall we use base classes or context injection for that? — This question has popped up at two of my clients, so I thought it would be worth discussing it also in a blog post.
SpecFlow creates and disposes the instances of your step definition classes automatically. It also allows injecting dependencies to these classes through a feature called context injection. This article shows how this injection can be configured to use the popular Autofac dependency injection framework.
In the first part of this article I described why it is important to provide more information on errors and how you can collect useful artifacts (screenshots, log files, etc.) in an [AfterScenario] hook. In this part I would like to explain how to write more informative assertions.
Many teams who use SpecFlow setup their continuous integration environment with Microsoft Team Foundation Server (TFS) or its cloud based service, the Visual Studio Team Services (VSTS, fka VSO). TFS/VSTS has an improved build system, where it is much easier to setup and customize builds. Regardless of the fact, which unit test provider you use […]