How to Create Better Unit-Testing with Microsoft Moles Framework Part II

31 באוגוסט 2011

This post is part II of Moles Framework, if you did not read part I (Moles overview and how to use Stubs) you can find it here.  In my previous post I explain how can we use Stubs to fake a class that implements an interface. We also learnt that Stub uses virtualization technique (like OOP) to achieve isolation. Moles Framework - Moles  But what if our DAL class does not implementing an interface…? Of course we don't use interfaces in all our code, how can we still gain isolation without interface? Moles! Or M J  Remember that after adding Moles assembly we had 2...
no comments

How to Create Better Unit-Testing with Microsoft Moles Framework Part I

Introduction Unit testing is something that we all do, even if we don't really use any framework for that such as MS Test or NUnit. If we're writing class library we usually create another console application project to test the methods and the behavior of the new classes. You can read my previous post about writing TDD and unit tests in Microsoft Visual Studio 2010 here. One of the goals of unit testing is isolation. When we unit test a method, we usually want to check that it behaves as accepted, without any other objects to interfere. For example, let's...
no comments

Manually Configure and Run code Coverage

30 באוגוסט 2011

There is an option to configure and run code coverage manually for running manual tests such as test cases with Microsoft Test Manager. It can be done with few command line actions that need to be run. Here are the actions: ·         Run VSInstr.exe to replace the DLL\PDB files with the instrumented ones ·         Run VSPerfCmd.exe to start the code coverage ·         Run VSPrefCmd.exe to stop code coverage VSInstr.exe In order to instrument our DLL(s), let's run the command(s):      ·         VSInstr.exe "AssemlbyFile.dll" /coverage After running, you can see that VSInstr.exe created the following files: ·         AssemblyFile.dll.orig ·         Assembly.Instr.pdb Actually, VSInstr renamed the original AssemblyFile.dll...
no comments

Process Template Comparer

26 באוגוסט 2011

Introduction Configuration managers in companies that use TFS need the ability to manipulate and change work Item templates according to the company's methodology. With Microsoft Process Template Editor that comes within Visual Studio Team Foundation Power Tools, we can edit work item templates: add new fields, change the UI and the state machine of work items and fit it to the company needs. All the sets of the customized work items, source control rules and build templates gathered and called process template.  The best practice is to have one process template in our organization so all development teams use it and...

Update Work Item Check-in policy

Managers and team leaders that work with TFS use Work Items to track and monitor the team's work and progress. Work Items are based-work-packages that define scope of work for a team member, a work item can be a developer task, investigation task and test task. With work items team leaders can watch and track of his team and the project progress.  2 important fields that I like to mention are Remaining-Work and Completed-Work; these fields show the real status of a task progress. When a developer finishes his task and likes to perform check-in to the changed code, he...