Showing posts with label Mocking. Show all posts
Showing posts with label Mocking. Show all posts

Tuesday, March 25, 2014

JustMock Lite - Free and open source too...

Telerik - JustMock Lite

For developers who practice unit testing and want to deliver exceptional software, JustMock Lite is the superior free mocking framework that makes unit testing simpler for SOLID testable projects. JustMock Lite is an open source product that is easy to use, feature rich, with great power and flexibility, making it the superior choice. JustMock Lite cuts your development time and helps you create better unit tests. It enables you to perform fast and controlled tests that are independent of external dependencies like databases, web services or proprietary code.
Like any open source software, JustMock Lite allows for full code transparency as well as easy product update and support by the community. JustMock Lite is the same set of assemblies as the commercial edition of JustMock, and just like JustMock, it is commercially backed with 3 major releases per year and continuous product improvement.

If you are dealing with a legacy code project or tightly coupled code that requires elevated mocking (such as mocking private, static, or sealed items), you need the JustMock full edition.


Why Choose?

  • Superior Free Mocking Framework
  • Commercially Backed
  • Open Source
  • Mocks SOLID Code
  • Arrange, Act, Assert Oriented
  • Error-Free Mocking
  • Automocking
  • Easy Migration to JustMock Full Edition

image ...

telerik / JustMockLite 

Welcome to the Telerik JustMock Lite source code repository!


JustMock Lite by Telerik is a powerful free mocking library available for .NET developers. For more information, refer to our JustMock Lite website. You can suggest and vote for feature requests in our JustMock feedback website.


JustMock Lite is also available in a Nuget package.


You can compile the JustMock Lite project with Visual Studio Express 2012 for Desktop and greater.

  1. In Visual Studio, open the Telerik.JustMockLite.sln file.
  2. Dismiss any Unsupported project type warnings. You can still build JustMock Lite.
    Visual Studio Express shows this warning to indicate that it does not support the Silverlight projects included in the JustMock Lite solution.
  3. Build the project in a DebugFree or ReleaseFree configuration.
    This will ensure that the JustMock Lite unit tests remain green.
  4. Locate the JustMock Lite binaries in the ..\..\Binaries folder.

Let us know if you encounter any issues with the project.


JustMock Lite is licensed under Apache 2.0 (

Happy mocking!

Not only free, but open source too... Nice. :)

(via tweet from @alvinashcraft)


Related Past Post XRef:
Telerik, are you just mocking me? Yep! With the Telerik JustMock Free Edition
"Why I Hate Unit Testing"

Wednesday, January 08, 2014

Faking it gets a little better... the "Better Unit Testing with Microsoft Fakes" eBook that is...

Willy's Reflections - Better Unit Testing with Microsoft Fakes – eBook update v1.2 posted

Thanks to Michael Fourie, we have been able to action the backlog of community feedback for recent versions and package as part of the v1.2 eBook update.

Where can I get the new stuff?


Visual Studio Test Tooling Guides - v1.2 - Better Unit Testing with Microsoft Fakes

Release Notes

Welcome to the Better Unit Testing with Microsoft Fakes eBook
Quality-Bar Details

  • Documentation has been reviewed by Visual Studio ALM Rangers
  • Documentation has been through an independent technical review (UE)
  • All critical bugs have been resolved
Known Issues / Bugs
  • EPUB and MOBI downloads are still v1.0 and we have no plans to upgrade to v1.2.
  • Also available in Spanish!


For modern development teams, the value of effective and efficient unit testing is something everyone can agree on. Fast, reliable, automated tests that enable developers to verify that their code does what they think it should, add significantly to overall code quality. Creating good, effective unit tests is harder than it seems though. A good unit test is like a good scientific experiment: it isolates as many variables as possible (these are called control variables) and then validates or rejects a specific hypothesis about what happens when the one variable (the independent variable) changes.

Creating code that allows for this kind of isolation puts strain on the design, idioms, and patterns used by developers. In some cases, the code is designed so that isolating one component from another is easy. However, in most other cases, achieving this isolation is very difficult. Often, it’s so difficult that, for many developers, it is unachievable.

First included in Visual Studio 2012, Microsoft Fakes helps you — our developers — cross this gap. It makes it easier and faster to create well-isolated unit tests when you do have systems that are “testable,” letting you focus on writing good tests and not on test plumbing. It also enables you to isolate and test code that is not traditionally easy to test, by using a technology called Shims. Shims use runtime interception to let you detour around challenging dependencies and replace them with something you can control. As we have mentioned, being able to create this control variable is imperative when creating high-quality, fast-running unit tests.

Shims provide a very powerful capability that will let you circumvent all kinds of roadblocks when unit testing your code. As with all powerful tools, there are a number of patterns, techniques and other “gotchas” that can take time to learn. This guidance document provides you with a jump-start on acquiring that knowledge by sharing a large number of examples and techniques for effectively using Microsoft Fakes in your projects.

We are happy to introduce this excellent guidance document produced by the Visual Studio ALM Rangers. We are sure that it will help you and your team realize the power and capabilities Microsoft Fakes provides you in creating better unit tests and better code.

A good book if you're looking for information about using the mocking/isolation framework from Microsoft, Microsoft Fakes.


Related Past Post XRef:
Faking it in VS11 - Moles, the Microsoft mocking/isolation framework, is baked into VS11

Interested in PEX & MOLES? Wish you could go to a five hour workshop on them? Here’s the next best thing…
Think you can’t unit test ASP.Net? Here’s a tutorial for one way, using the power of Pex and Moles

Monday, October 15, 2012

Free your Typemock... New Typemock Isolator Basic is now available and free (Updated Typemock Isolator Essential & Typemock Isolator Complete also available)

ASP.NET Forums - Announcements - Typemock releases a new version of Isolator, suitable for all levels of software developers – including a FREE version

"Unit testing is a key element for any software developer, development team, or business. With proper unit testing, companies can reduce the cost of software defects while maintaining code quality and allowing for faster time-to-market. Typemock is committed to making unit testing easier and more accessible to developers and organizations.

The new Typemock Isolator packages provide easy unit testing tools to all developers as well as organizations based on their specific needs.

All versions support ASP.NET and ASP.NET MVC as well as the rest of .NET Framework

Typemock Isolator Basic - The basic package is a FREE unit testing framework, for developers without legacy code to test, which provides basic mocking functionality along with the smartrunner and coverage indicator features only. With Isolator Basic anyone with green field projects can unit test and engage in Test Driven Development with the proven power and benefit Typemock offers.

Download it now:

Typemock Isolator Essential - ...

Typemock Isolator Complete - ..."

Typemock - Typemock Isolator - Easy Unit Testing in .NET

Isolator is a complete unit testing and Test Driven Development (TDD) solution, which helps you work smarter and prevent costly bugs in your code.


Free is something that's easy for me to sell. Sure the free version is limited, but it looks like there's enough there to get a feel for the product before you spend the big bucks on it...


(via dotNetSlackers - Typemock releases a new version of Isolator, suitable for all levels of software developers including a FREE version.)

Wednesday, April 11, 2012

Telerik, are you just mocking me? Yep! With the Telerik JustMock Free Edition

KodefuGuru - Looking for a Free .NET Mocking Framework?

Are you already using SOLID principles in your code? Check out Telerik JustMock Free Edition. It's even available on NuGet!

You may be thinking to yourself, "Why bother when there are so many other alternatives?" I will give you just a few reasons...

  1. JustMock Free is the best free mocking framework (try it out for yourself).
  2. It's supported by a well-known and trusted vendor, Telerik.
  3. It's the brainchild of Mehfuz Hossain, author of awesome open source frameworks such as AutoBox.
  4. Here's the most important reason: if you find yourself in need of an extremely powerful mocking framework that can mock things like static classes, LINQ queries, and inject them regardless of how the code is constructed, your developers will already be familiar with the framework when you use the commercial edition.

Here are some items that JustMock Free Edition supports:


While VS11 will having a mocking framework in the box, that's still in the future (even though you know there's a Go Live on the VS11 beta, right? That you can, and it's supported, use VS11 in production? And that they'll support upgrading from the VS11 beta to RTM?) it's always nice to have some options and it's hard to go wrong when that option is free and from a top tier ISV like Telerik.

The icing on the cake for me was that they made it available via Nuget... nice...

Monday, March 12, 2012

Faking it in VS11 - Moles, the Microsoft mocking/isolation framework, is baked into VS11

Cook Computing - Faking In Visual Studio 11

The Problem

Dealing with Now and why I'm almost done with C# and Java — Karl Seguin's post about how the way you code is a by-product of the progamming language you use — discusses how difficult it is to test unit code like this in C#:


Visual Studio 11 Fakes

Some of the comments mention TypeMock Isolator and the Moles project from Microsoft, and it so happens the Visual Studio 11 beta reveals that Moles has been productized into Visual Studio as the Fakes Framework. This can inject two types of dummy implementation into unit tests: stub types for interfaces and overridable methods, and shim types for static and non-overridables methods:


Faking DateTime

To test the DateTime code, create a unit test project and right click on one of the referenced assemblies in Solution Explorer. This displays a context menu which has an "Add Fakes Assembly". Select this and two more referenced assemblies are automatically added to the project:

  • Microsoft.QualityTools.Testing.Fakes
  • Microsoft.VisualStudio.QualityTools.UnitTestFramework.

Visual Studio will automatically generate a file called Microsoft.VisualStudio.QualityTools.UnitTestFramework.fakes in a directory in the project called Fakes. This XML file is used to configure the assembly for which fakes are generated and the namespaces and types that are included. We want to generate a shim type for DateTime so we can change the file to specify the mscorlib assembly:



I've not seen too much talk yet on this, on how VS11 will have an isolation/mocking framework built in and in the box. They've been working on Moles for a while now and it's good to see it make it into the mainstream product, that should help adoption some. Now what I don't know is if you can replace it with others, like you can the unit testing frameworks in VS11?


Related Past Post XRef:
Interested in PEX & MOLES? Wish you could go to a five hour workshop on them? Here’s the next best thing…
Think you can’t unit test ASP.Net? Here’s a tutorial for one way, using the power of Pex and Moles

Friday, November 12, 2010

How about some free MVVM training/hands on/walkthroughs right in the VS box? “In the Box – MVVM Training” from Karl Shifflett (Oh yeah, with some WPF, Test, Moc, and Prism too)

Karl on WPF - In the Box – MVVM Training


What is In the Box?

In the Box is a high quality, multi-media training that is consumed within Visual Studio 2010.  Content is navigated and delivered using a next generation computer based training (CBT) experience, the Visual Studio 2010 Feature Extension.

In the Box, is a brand name for a series of CBT Feature Extensions I’ll release that are listed in the Visual Studio 2010 Add New Project dialog; see below image.  This release is MVVM Training, the next will be Prism Training.

In the Box features:

  • Visual Studio 2010 Feature Extension
  • Content delivered as text, code, images, diagrams, video, or hyperlinks to the Internet
  • Hierarchical navigation tool window for content navigation
  • Content is viewed inside Visual Studio 2010 tool windows
  • No additional downloads or dependencies; all content is in the box.  (except online videos)
  • Installed and updated from the Visual Studio Gallery
  • Managed (disabled or uninstalled) using Visual Studio Extensions Manager (see bottom of this page)
  • Authored using Microsoft Word and the Instant Feature Builder

This installment of In the Box contains in-depth MVVM Training that includes an eleven assembly example solution with projects targeting developers at different levels of experience

Who is the target audience?

  • If you have never used MVVM before, this training is for you. 
  • If you have been using MVVM for a while and want to learn more, this training is for you. 
  • If you are an expert, you will enjoy the MVVM Technical Description and MVVM Scenarios content.


As you seen in a couple recent posts, I really like the idea of training that’s baked into the VS box/IDE/experience. So when I saw this (and that it was built using Instant Feature Builder that I also just blogged about) I had to check it out…

Here are some snaps of it in action.

In Extension Manager, search for “MVVM Training”;


New Project (only available for C#);


Check out the scope of the training. We’re  talking some serious content here…



And yeah, it’s free. Now that’s a deal that is hard to beat…



Related Past Post XRef:
Feature Builder power with drag and drop simplicity - Instant Feature Builder v1 (Think “Drag and Drop Map/Code files/Docs/Guidance in and vsix out”)

Wednesday, December 16, 2009

Best of UK MSDN Flash 2009 eBook

Goto 100 - Development with Visual Basic - FREE MSDN Flash eBook of the best 13 technical articles of 2009


The UK MSDN Flash developer newsletter contains great short technical articles written by UK developers both inside Microsoft and in the broader developer community. This eBook pulls together these great articles in one place. There are thirteen articles in this second edition covering Python, Inversion of Control, Behavior Driven Development, Silverlight and more.


Snap of the cover;


From the Table of Contents;



Memory Maped Files with .NET Framework 4.0


Why IronPython?


Why do I need an Inversion of Control Container?

Technical Debt

Neural Networks

Getting Started with the Managed Extensibility Framework

Is BDD just TDD with a different name?

Test Doubles, Mocking and Stubs


ASP.NET 4.0 Web Forms


Generate Office 2007 Documents with the help of DocumentReflector

Model-View-ViewModel gets the most out of WPF and Silverlight

Consuming real-time data in a Silverlight RIA


Some short but cool articles, easily read and consumed.


Related Past Post XRef:
UK MSDN Flash – Best of 2008 #1 in eBook form

Wednesday, September 02, 2009

Unit testing database code via mocking/isolation and the Repository pattern - “Eliminate Database Dependencies in Test-Driven Development”

Visual Studio Magazine - Eliminate Database Dependencies in Test-Driven Development


Many developers are tasked with writing unit tests as test-first design and development becomes commonplace, even on teams that aren't strictly practicing Agile methodologies. Test-driven development (TDD) can produce cleaner code by requiring project teams to first write unit tests that fail, then program just enough code for a needed function, retest, refactor and repeat the cycle. If you haven't written code using TDD, starting from a failing test sounds awkward. But it's this extra bit of thought about what you want to achieve that gives you a clearer understanding of what you need to accomplish.

If you're writing an n-tier application using Visual Studio and you're using TDD, it's not uncommon that your unit tests for business-tier functionality read and write to a database. In order for these tests to run, you need a running database with the most up-to-date schema along with any supporting data.

In this article, I'll show you how to leverage the Repository pattern to eliminate the dependency on SQL Server from your unit tests and, in the process, improve your application's testability. The unit-testing features that I discuss in this article are all available in Visual Studio 2008 Professional Edition and in all Visual Studio 2008 Team Editions. The sample application is written in Visual Studio 2008 Team Suite and requires an instance of SQL Server or SQL Express. See the readme.txt for information about how to set up the database and where to find the connection string.


This is one of the challenges in our code base, it’s very old (sigh.. upgraded from VB6… sigh… but it works at least…  ;) and was not designed for isolation nor unit testing. Not that we don’t test! We have thousands of tests in our CI process, but those are really “integration” tests and not “unit” tests. While I’m nowhere near a test zealot, I would really like to be able to execute some DAL testing without having to jump through database setup/rollback/etc hoops.

That’s why this article caught my eye. Added to my stack of stuff to read and grok… ;)

(via Benjamin Day Consulting, Inc.: The Blog - Article: “Eliminate Database Dependencies in Test-Driven Development”)

Tuesday, April 14, 2009

Mocking introduction for the Discerning Dev Dude - Spaghetti Code Talks Mocking with Donn Felker

Spaghetti Code Podcasts - Donn Felker Talks Mocking

“Spaghetti Code Talks with Donn Felker about how developers can use mocking in their unit tests and some of the approaches to being successful.


Mocking/Isolation is something I’m interested in yet I’ve not made the leap. Why? Well I understood the concept and reason (and like it) but still felt I wasn’t really “getting it”.

After listening to this cool cast, the light has begun to come on (you know how those CFC’s take a while to light… ;)

If you’re interested in mocking and want to get a feel for just what it’s about, all in 45 minutes or less, check out this podcast.


Related Past Post XRef:
Isolation Framework, are you Mocking me?
Mocking is good thing… when unit testing at least – Intro to Mocking