.NET software testing tutorials: unit testing, open source, NUnit, SpecFlow, Visual Studio, etc.
This is a series of three posts by Nick Olson about the topic of unit testing your code your when you are writing a javascript client application with a .NET backend. The first post is an introduction that defines the context and presents the tools that will be used. The second post provides the code to test the javascript using KnockoutJS and Qunit. The third post explains how see the javascript unit tests results when you are inside Visual Studio. This is achieved using a browser automation tool walled Watin and a data-driven unit test in C#.
SpecFlow is an acceptance test driven development and behavior driven development for .NET. One of them the biggest challenge in using SpecFlow is to improve the efficiency of the automated testing process. Typical questions are about organizing feature files, keeping the specification language consistent, refactoring feature files, automation code maintainability, better feedback from failing tests, test execution time or handling stability issues.
Visual Studio allows you to create automated tests of the user interface (UI) known as coded UI tests. These tests provide functional testing of the UI and validation of UI controls. This article provides test automation guidance that helps you leverage the coded UI features of Visual Studio 2010 to foster a continuous, consistent and standard automation approach. Such an approach allows you to build, deploy and test, taking advantage of Visual Studio Lab Management features, which let automation testers reap the benefits of integrating with the build process for automatic build deployment, executing on VMs and reporting test automation results as part of Microsoft Test Manager (MTM). The article provides also a list of Do’s and Don’ts of UI automation. UI automation can be a tricky business. To help you get the best results, follow the advice, guidance and best practices for writing coded UI tests in the following Do and Don’t lists.
This article provides a general overview of behaviour-driven development (BDD) in a .NET context. I presents some .NET tools for BDD (SpecFlow) and UI testing (White) and proceeds with a working example giving hands on BDD in .NET. SpecFlow is an open source tool aims to provide a pragmatic and frictionless approach to Acceptance Test Driven Development and Behavior Driven Development for .NET projects. White is an open source framework for automating rich client applications based on Win32, WinForms, WPF, Silverlight and SWT (Java) platforms. It is .NET based and does not require the use of any proprietary scripting languages. Tests automation programs using White can be written with whatever .NET language, IDE and tools.
SpecsFor.Mvc is an open source tools that allows you to create automated acceptance tests using browser automation, meaning your entire application is tested from the UI all the way down to the database, exactly as a real user will use your application. However, unlike many other solutions which rely on recording actions or require you to learn a completely new framework and syntax, SpecsFor.Mvc uses familiar unit-testing tools and syntax.
This blog post presents the changes to unit testing made in the new version of Visual Studio. The Test View and Test Results windows have been replaced by the Unit Test Explorer, a new user interface that let developers quickly interact with their tests. Third party test frameworks are supported by a new test meta-runner that coordinates and controls the flow of data between the user interface and the underlying test frameworks. Visual Studio will also provide a true native unit testing framework for C/C++. A new test isolation and stubbing framework for managed .NET code called Visual Studio Fakes has been added. A new feature allows also to tests after each successful build. Some Visual Studio 2010 test features have been removed.
This video provides an overview of the methodology used to easily unit test your Asp.Net (aspx) pages with the open source dll ApprovalTests.