WF4: How to Unit Test a Workflow that calls a WCF Service

“The important point is that our test can’t control what that dependency returns to our code under test or how it behaves (if we wanted to simulate an exception, for example). That’s when we use stubs.” – The Art of Unit Testing – Roy Osherove, Yesterday morning I received an email from Ryo in Belgium…

5

New Release Microsoft.Activities.UnitTesting 1.71

Just posted a new release of Microsoft.Activities.UnitTesting This release incorporates the Task Parallel Library to greatly simplify test code. Episodes You can now create a task that will run an episode of work in the workflow. An episode is simply a pulse of work that the workflow runs. For example an episode might look like…

0

I Love TDD and Code Contracts

After spending a few days writing a ton of code and heavily refactoring using TDD and Code Contracts I have to say… Wow! I know people like to debate the value of TDD, test first etc.  I don’t care what they say – this method rocks.  I found bugs I would have never found any…

0

The specified module ‘DistributedCacheAdministration’ was not loaded because no valid module file was found in any module directory.

What to do if you get this error when unit testing Windows Server AppFabric Caching Being new to unit testing code that invokes PowerShell I ran into this problem when trying to test code that was using the Windows Server AppFabric Caching cmdlets. System.Management.Automation.Runspaces.RunspaceOpenModuleLoadException was unhandled by user code   Message=One or more errors occurred…

0

Using Moq with Windows Server AppFabric Caching

Last week I tried doing TDD with Windows Server AppFabric.  In my previous post I shared with you my conclusions.  To sum it up, doing TDD with AppFabric caching is painful; even more painful than using a database in your unit tests. Over the weekend I decided to see if I could use Moq to…

1

Unit Testing with Windows Server AppFabric Caching

I like to do TDD whenever I can.  So today I was writing some code that would be using the distributed cache features of Windows Server AppFabric and I decided to write unit tests first and then implement my code. Writing code that uses an external store like a file, a database or a distributed…

3