Home » Archives

Content tagged with: .net

[14 May 2012 | No Comment | ]

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.

[1 May 2012 | No Comment | ]

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 …

[27 Apr 2012 | No Comment | ]

This video provides an overview of the methodology used to easily unit test your Asp.Net (aspx) pages with the open source dll ApprovalTests.

[19 Apr 2012 | No Comment | ]

Running your SQL Server database unit tests within the scope of a single transaction allows you to roll back any changes that the test enacted after the test ends. This article propose a step by step approach to achieve this goal. You start to create a transaction in your Transact-SQL test script that uses BEGIN TRANSACTION and ROLLBACK TRANSACTION. Then you will create a transaction for a single test method in a test class and then a transaction for all test methods in a given test class.

[22 Feb 2012 | No Comment | ]

Unit testing is a difficult but essential activity to improve software quality and team velocity. This video presents the best practices to perform unit testing in a .NET context and with an agile approach.

[15 Feb 2012 | No Comment | ]

This article provides a process to integrate Test-Driven Development in the maintenance of a .NET application. You will first write the tests that will prove your new code gets the same results as the legacy code. Then you isolate new code into separate methods or classes that you can test independently. You break down the requirements into simple valid tests. Finally you check to see that you have not introduced a new bug. While you are doing this, let Visual Studio generate the utility code for you and find a …

[15 Feb 2012 | No Comment | ]

Rowan Miller shows how to replace a DbContext based data access layer with an in-memory fake for unit testing in this blog post. He builds an interface that represents the context and then builds an in-memory fake of that context for use in our unit tests. He uses an MVC controller but the same approach can be used with any component that needs to interact with an EF based context, including repositories. The key benefits of this approach are stable and robust tests that execute quickly and exercise a single …

[6 Feb 2012 | No Comment | ]

This article provides a detailed description on how use Pex and Moles to generate unit tests for a project having external dependency(WCF Proxy) using Visual Studio 2010 SP1. The Pex tool, which automatically generates test suites with high code coverage, will be used to generate unit tests. Moles allows to replace any .NET method with a delegate. They will be generated to isolate the external dependency (WCF proxy) and behavior will be redefined using delegates.

[2 Feb 2012 | No Comment | ]

This video describes the six mechanisms in Visual Studio 2010 that enable more effective collaboration between developers and testers. These mechanisms include tools to create actionable bugs, debug historical events, and automate functional testing. Effective collaboration between developers and testers is paramount and can make the difference between shipping quality applications on time, or slipping because bugs are found late.

[30 Jan 2012 | No Comment | ]

This article presents a simple and efficient engine which produces mutations of source code written in C# with helps testing it. The novelty of this engine is that it produces mutations that do not contradict with the specifications of the program. The latter are described by a set of pre- and post-conditions and invariants. The engine comprises two parts, a static analysis and syntactic verification component and a mutation generation component. Preliminary experiments showed that the proposed engine is more efficient than a simple mutations generator in terms of producing …