My team is currently locked into using a tool we dislike that takes the form of a Eclipse plugin and a .jar; the plugin gives us a button to quickly run a single file’s code (via invoking the main .jar and passing to it the current file). We want to move to C#.net. Is there any way to get Visual Studio to replicate this behavior? Obviously we could put each runnable class into its own project in our solution, but that requires checking a lot of project files into source control. Ideally we’d have a main() method in each file and could tell visual studio to run just that file for development purposes, while the finished software would be run from a single entry point using command-line parameters.
(I don’t want to give too much information here regarding the purpose of the software, so please just accept that the current setup makes a lot of sense for what we’re doing and changing it too much would be rejected by management.)
7
What you are describing should be covered by a unit testing framework (to test your different classes in isolation).
nUnit supports categories, allowing you to selectively run sets of unit tests as needed.
2
I believe it could be done like this, but I’m not sure if it can really be implemented.
It would implemented Visual Studio addon, this addon then adds a popup action to source files. When action is executed, the code is compiled into assembly. Then using reflection, the class in file is found and checked against contract. This contract can be either interface of specific method. This contract is then executed.
I believe that TestDriven.Net has this feature. Simply right click on a methid and then select the TestDriven.Net “test with debugger” option http://testdriven.net/quickstart.aspx