Faking The Windows Azure Table Service

When presented with a new technology, one of my primary evaluation criteria is its testability, so it should come as no surprise to the regular reader of this blog that this was also foremost in my mind when Windows Azure was presented at PDC. Much of the Azure Services Platform is just .NET, so testability…

1

A General-Purpose Fake ADO.NET Data Service

In my previous post, I discussed how to implement a Fake ADO.NET Data Service for use with unit testing, showing how you can develop a one-off service that addresses specific needs, such as querying parents and children in the example. As I hinted in that post, it’s possible to create a reusable Fake ADO.NET Data…

2

Creating A Fake ADO.NET Data Service

Previously, I discussed unit testing ADO.NET Data Service clients using a Fake ADO.NET Data Service, and I promised to demonstrate how to create such a service. In this article I will continue the previous example and implement the Fake MyService class. The basics of MyService is pretty simple: public partial class MyService{    public MyService()    {       …

1

Unit Testing ADO.NET Data Service Clients

In my previous post, I discussed unit testing ADO.NET Data Services and how you can host and test the service itself. In this post, I’ll take a look at the opposite scenario: You have a client of an ADO.NET Data Service, and you want to unit test the client without relying on the real, production…

4

Unit Testing ADO.NET Data Services

ADO.NET Data Services enables you to expose data (including, but not limited to, relational data) as REST services. Since it’s built on top of WCF, it can be tested utilizing similar techniques, but allow me to elaborate a bit on the subject. As with WCF, you might be interested in testing one or both tiers:…

4

Test-Driven Properties

Zero-Friction TDD post #10: In principle, defining properties (or fields, for that matter) while TDD’ing should be no different than defining methods. Again, the important part is to stay focused on the test at hand, and not become bogged down by implementation details. Unfortunately, neither Visual Studio 2005 nor 2008 has a Generate property stub…

1

Use The Generate Method Stub Smart Tag To Stay In The Zone

Yet Another Zero-Friction TDD Article (YAZFTA): When writing unit tests in the TDD fashion, it’s important to stay in the zone and not get side-tracked by irrelevant issues. You need to avoid what I call mental context switching. Focus on writing the test and postpone all else to later, but make sure that you do…

6

Assert Messages Are Not Optional

…and now, in this week’s episode of Zero-Friction TDD: Optional Assert messages that aren’t optional anyway! Actually, this piece of advice comes almost directly from the xUnit Test Patterns book, so I was in doubt whether I should post it all, but it bears repeating, and I guess I still have a few things to…

5

Why Use AreEqual<T>?

This is a post in my Zero-Friction TDD series. One of my colleagues recently asked my why I prefer Assert.AreEqual<T> over one of the non-generic Assert.AreEqual overloads for primitive types. In most cases, I’m very happy with the C# compiler’s ability to infer generic type arguments from the method call parameters, but this case is…

1

3 Is Many

This is an installment in my Zero-Friction TDD series. When I was a kid, my parents taught me that many is any number above three two*; they used the simple counting sequence one, two, many. This little story may make me seem like I was an incredibly dim-witted kid, but the point was obviously not…

2