If I write a class library in Visual Studio, is it possible to write a console application or powershell script which can call the methods or set/get the properties?
This is useful for testing APIs without having to create a form with loads of buttons etc.
I actually meant my executing my own class libraries. So if I write a class library with a namespace of a.b with a class called c and a method in c, called test(), I’d want to execute this from a console app or PS.
Thanks
PowerShell makes it even easier than a console app, just open the PowerShell console and new up your object. You can then set properties, call methods, etc.
I should be clear this is really most useful for doing spot checking or trying out a new API. In most cases using some kind of unit testing framework (MSTest, NUnit, etc), as others have mentioned, will give you better return on your time investment.