Kevin Dente's Blog

The Blip in the Noise
Whidbey Object Test Bench

The Whidbey May CTP documentation describes a new IDE feature called Object Test Bench. It sounds like this allows you to create instances of objects and poke at them in the design environment, without having to create a test project and write code. Looks neat, but either it isn't hooked up yet or I just can't figure out how to work it. Anybody know?

I'm not entirely sure how much I'll end up using this feature, as I've grown accustomed to keeping code explorations in NUnit test suites that I refer back to when I need to. But it seems to be worth a look, anyway.

Published Wednesday, June 02, 2004 6:38 PM by kevindente

Comments

# re: Whidbey Object Test Bench@ Thursday, June 03, 2004 11:13 AM

It does work, although sporadically...

You need to create a class diagram to use it. Create a class diagram, add a class to it, then compile. Now, open up the Object test bench window "View | some menu I don't remember | object test bench". Now, in your class diagram, choose "create instance" (or some such. Whatever you name your instance in the next dialog will show up as a box in the object test bench. You can call methods, check properties, and so on.

I think it will be great for things like code reviews, debugging, etc.. but it's no substitute for unit tests which should cover everything you could do here.

Philip Rieck

# re: Whidbey Object Test Bench@ Monday, June 07, 2004 2:44 AM

Actually, you don't need to create a class diagram. You can go to the Class View and right click on a class and select 'Create Instance' to create an instance of the class. The Object Test Bench wasn't fully functional in the May CTP, but the Beta 1 bits will have a fully working version.

Umesh Unnikrishnan [MSFT]

# re: Whidbey Object Test Bench@ Monday, June 07, 2004 2:53 PM

Umesh,
From your comment, I'm uncertain - should "Create Instance" be available on the class view for the May CTP? I don't see such on option on my installation.

Kevin Dente

# re: Whidbey Object Test Bench@ Tuesday, June 08, 2004 2:28 AM

I'll have to check, but I'm pretty sure it should be there. If your class has a public constructor, then if you right click on that class in Class View, there should be a 'Create Instance' menu item.

Umesh Unnikrishnan [MSFT]

# re: Whidbey Object Test Bench@ Tuesday, June 08, 2004 10:22 AM

btw, this works only in C# and J#

Umesh Unnikrishnan [MSFT]

# re: Whidbey Object Test Bench@ Tuesday, June 08, 2004 2:05 PM

Nope, no luck. I created a trivial C# class with a public constructor, right click on it in class view, but no "Create Instance" option. Perhaps I need to wait until beta 1. Thanks anyway.

Kevin Dente

# re: Whidbey Object Test Bench@ Friday, June 11, 2004 7:20 PM

My question is how the Object Test Bench differs functionally from design-time expression evaluation now available in the Immediate window? At first glance, I expect OTB gives you a lot more features.

Peter Bernhardt

# re: Whidbey Object Test Bench@ Monday, June 14, 2004 12:10 AM

Hmm, work's great here. I just type in an expression (MyClass m = new MyClass();) and away it goes.

I'm using a newer build than the May CTP, so maybe it's been fixed.

Michael Giagnocavo