Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Productivity   (RSS)

testmethod Code Snippet

This is an installment in my Zero-Friction TDD series. If you are a regular reader of this blog, you may have noticed a certain pattern in my unit test examples (like this one ). This is because I always follow the Four-Phase Test pattern (which is a
Posted by ploeh | 1 Comments
Attachment(s): testmethod.snippet

Ignore Irrelevant Return Values

This is an installment in my Zero-Friction TDD series. Sometimes, you don't care about the return value from a particular operation. The simplest example is if you want to check that creating a new instance of a specific type will throw an exception if
Posted by ploeh | 1 Comments

Anonymous Variables

This post is an installment in my series on Zero-Friction TDD . Often when writing a unit test, the SUT 's API will force you to create objects that you really don't care about. As an example, take a look at the signature of this constructor: public Plop(
Posted by ploeh | 2 Comments

Naming Direct Output Variables

In my series of Zero-Friction TDD tips and tricks, it's time to look at naming Direct Output variables. [ TestMethod ] public void DoStuffWillReturnMessage() {     // Fixture setup     string expectedResult = "ploeh"
Posted by ploeh | 1 Comments

Zero-Friction TDD

Writing good code is difficult. Unit tests are written as code, so a corollary to the first sentence is that writing good unit tests is also difficult. TDD (particularly if you interpret the last D as Design ) carries this challenge in abundance, since
Posted by ploeh | 3 Comments

Vote For Better TDD Support in Visual Studio 2008

Eric Jorgensen has created a Microsoft Connect item asking for better TDD support in Visual Studio 2008 . If you also miss the green (sometimes red) progress bar and other UI elements of NUnit and similar tools, and think that Visual Studio should have
Posted by ploeh | 1 Comments
Filed under:

Automatically Generating LINQ To SQL Models From T-SQL

With LINQ to SQL, a couple of questions quickly arise: Since you can create a data model directly in Visual Studio, where's your authoritative definition of the database? If you generate a data model from your database, how do you maintain the model if
Posted by ploeh | 3 Comments
Filed under:

Attachment(s): DacIntegrationTestLinqToSql.zip

Visual Studio 2008 PowerShell

Ever since I first saw a demo of PowerShell some five years ago, I've been wanting to use it for development work; such as automating code generation or whatever other task for which small scripts are needed. It's such a powerful environment, and I simply
Posted by ploeh | 2 Comments
Filed under:

Attachment(s): vsvars32.ps1

Race Troubleshooting Using The Console Output In VSTS

It must be my week of discovering the obvious . The other day I was troubleshooting a race condition in my code. I had a unit test that faithfully reproduced the error, but just looking at the code involved didn't produce any sudden insights into its
Posted by ploeh | 3 Comments

Agile Proves Effective Once More

Christian , one of my old (and present) collegues, has just posted about his team's latest accomplishment , shipping six months ahead of time! I'm sure that the team consists of a bunch of very talented people, but I'd also venture a guess that their
Posted by ploeh | 1 Comments
Filed under:

SQL Server On Vista Development Machines

As an enterprise developer, I've always had SQL Server on my laptop (which is my main development machine), and it's been quite some time since I got my first laptop (1999). For years, SQL Server has been an indispensable tool for enterprise development,
Posted by ploeh | 3 Comments
Filed under:

cleantestresults XML Snippet

About a year ago, I wrote about an automated way to clean up the TestResults folder created by VSTS. While I still use this approach methodically, I've begun to find it tedious to find my original post to copy and paste the XML into the project file.
Posted by ploeh | 0 Comments
Attachment(s): cleantestresults.snippet

Testing Against The Passage of Time

This is the fourth in a small series of posts about testing against non-determinism. In this installation, I'm going to cover the passage of time. In my former post , I demonstrated how you can use the Provider Injection pattern to decouple your test

Vote For Generic Set Class

From time to time, I find myself in a situation where I need a class that mimics the behavior of a mathematical set: Elements are unordered An element can only appear once Sets can interact via Union, Intersect, Difference, IsSubset, IsSuperset, etc.
Posted by ploeh | 7 Comments
Filed under:

Vertical Guidelines in Visual Studio

From time to time, I've found myself wishing that Visual Studio had vertical guidelines in the code editor. This may not apply to all developers, but in some scenarios, I'd really like to have a visual right border when writing code. In my case, it's
Posted by ploeh | 2 Comments
Filed under:
More Posts Next page »
 
Page view tracker