background preloader

Testing Tools

Facebook Twitter

Prig: Open Source Alternative to Microsoft Fakes By: @urasandesu. Prig(PRototyping jIG) is a framework that generates a Test Double like Microsoft Fakes/Typemock Isolator/Telerik JustMock based on Unmanaged Profiler APIs.

Prig: Open Source Alternative to Microsoft Fakes By: @urasandesu

This framework enables that any methods are replaced with mocks. For example, a static property, a private method, a non-virtual member and so on. As of Oct 12, 2015, Released V2.0.0. Let's say you want to test the following code: using System; namespace QuickTour { public class LifeInfo { public static bool IsNowLunchBreak() { var now = DateTime.Now; return 12 <= now.Hour && now.Hour < 13; } } } You probably can't test this code, because DateTime.Now returns the value that depends on an external environment.

Step 1: Install From Chocolatey Install Chocolatey in accordance with the top page. CMD C:\> choco install prig -y. Using Stubs and Shims to Test with Microsoft Fakes in Visual Studio 11 - Rich Czyzewski. Microsoft Fakes is an isolation framework for creating delegate-based test stubs and shims in .NET Framework applications.

Using Stubs and Shims to Test with Microsoft Fakes in Visual Studio 11 - Rich Czyzewski

The Fakes framework can be used to shim any .NET method, including non-virtual and static methods in sealed types. Additionally here is Wikipedia’s definition of Mock Object for reference In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts. Microsoft Fakes Framework in Visual Studio 2012. In Unit Testing/Test Driven Development (TDD) Isolating dependencies, sometimes referred to as “mocking objects” or “faking objects” is a norm.

Microsoft Fakes Framework in Visual Studio 2012

There are many books/articles that have been written on this topic. There are also great frameworks out there, which allow us to isolate dependencies without having to use any hand written mocks/fakes. Visual Studio 2012 new Fakes framework takes faking/mocking objects to a new level. In this article, I will explain the features of Visual Studio 2012 Fakes framework. Also please remember that, currently the Fakes framework is only available in Visual Studio Ultimate edition. ASP.NET, MVC, WPF - Grids, Charts, Reports and More. Some history behind the Fakes Framework. Unit testing - Mock framework vs MS Fakes frameworks.

Isolating Code Under Test with Microsoft Fakes. Microsoft Fakes help you isolate the code you are testing by replacing other parts of the application with stubs or shims.

Isolating Code Under Test with Microsoft Fakes

These are small pieces of code that are under the control of your tests. By isolating your code for testing, you know that if the test fails, the cause is there and not somewhere else. MSpec Test Adapter extension. Machine/machine.specifications - GitHub.

Pex

Using a load test plugin to limit the number of tests run in a load test - Bill Barnett's blog. Normally the number of iterations of the inner tests (usually web tests and unit tests) run during a Visual Studio Team System (VSTS) load test is determined by the duration of the load test.

Using a load test plugin to limit the number of tests run in a load test - Bill Barnett's blog

However, some users which to control the number of inner test iterations exactly. 6 free mobile device emulators for testing your site Webdesigner Depot. The percentage of all web usage that comes from smartphones and other mobile devices is growing, and it won’t be long before mobile internet users overtake desktop and laptop users in terms of web traffic.

6 free mobile device emulators for testing your site Webdesigner Depot

So it’s a cardinal sin to ignore mobile users when you’re developing a website. One of the most important things you can do to make a website mobile-friendly is to test it on multiple smartphone and tablet platforms. Luckily, mobile emulators make it easy to do this. A mobile phone emulator lets you check the responsiveness and functionality of the website across different mobile platforms, such as iPhone, iPad, Android and BlackBerry, without actually having the devices in hand. Mobile emulators can help you pinpoint problems and issues with the website and allow you to take corrective measures to make the website visually appealing and functional on mobile devices. iPad Peek iPhone Tester As the name suggests, iPhone Tester is one of the most popular mobile emulators for iPhones. Verde. Overview Verde is an integration test and application health verification framework for ASP.Net MVC.

Verde

Integration tests are intended to automate verifying the different components of your application such as databases, web services, etc. are working together correctly. Unlike test runners integrated into Visual Studio or standalone applications, the Verde framework runs tests directly within your web application; leveraging the same configuration settings, security permissions, network topology, etc. This allows exposing issues that may not otherwise be encountered until an end-user actually starts using the application. Verde is intended to complement a robust suite of unit tests; the unit tests ensure all the individual units of work function correctly, while integration tests ensure everything works together. The easiest way to add Verde to your project is via NuGet - PM> Install-Package Verde Getting Started Here is a sample JSON response from the /execute command:

Testing made easier in Internet Explorer. DeCSS3 - a bookmarklet for graceful degradation.