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.

8 Comments

  • 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.

  • 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,

    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.

  • 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.

  • btw, this works only in C# and J#

  • 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.

  • 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.

  • 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.

Comments have been disabled for this content.