Content tagged with: .net
This article provides an article on how to create unit tests for a Visual C# class in a Windows Store app with Visual Studio Express 2012 for Windows 8 and the Microsoft Unit Testing Framework.
This article from Keith Burnell presents best practices and techniques to increase the testability of ASP.NET MVC applications. This includes how to structure the solution, architecting the code to handle the injection of dependencies and implementing dependency injection with StructureMap.
This article explains how you can set up a unit test method that will retrieve values used in the test method from a data source using the Microsoft unit test framework for managed code. Creating these data-driven unit tests makes it easy to test a multiple inputs with a single method.
In this blog post, Dror Helper presents a short “getting started” procedure to do Behavior Drive Development (BDD) with SubSpec. SubSpec allows developers to write declarative tests operating in C# at all layers of abstraction consisting of highly composable, small primitive concepts. SubSpec is based on the xUnit testing framework and can easily be integrated into existing testing environments. The blog post shows how to write its first behavior test and how to run all the assertions in one test.
Best practices for unit testing are that you should only write for each test a single assertion. In this article intends, Jonathan Allen tries to demonstrate that unit tests with multiple assertions are both necessary and beneficial.
This article explains how Microsoft Fakes perform a similar role than mocking in unit testing, helping you to isolate the code you are testing in Visual Studio by replacing other parts of the application with stubs or shims. A stub replaces another class with a small substitute that implements the same interface. A shim modifies the compiled code of your application at run time so that instead of making a specified method call, it runs the shim code that your test provides.
Replace any .NET method with your own delegate! “Fakes” is a new framework in Visual Studio 11 for test stubs and detours in .NET. Fakes may be used to detour any .NET method, even in tough situations like static methods, non-virtual methods, private methods, constructors, etc… If you’ve been a user of Moles, Fakes is a lot like Moles but different so come and learn about the changes coming ahead too.
In this blog post, Rui Sun and Andre Hamilton explore some Visual Studio 2012 capabilities that will make it easier to test and verify Windows 8 applications. Visual Studio 2012 has a simulator that reduces your need to have physical devices of every form factor at your disposal for testing. You can launch your application in the simulator directly from within the Visual Studio through the debugging action. Then you can interact with your application using the mouse or using simulated touch on your development computer with gestures like swipe, …
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.