You can indeed write custom attributes (without changing MbUnit source) but that won't help you here. In fact, I don't think there's a way to disable support for "standalone" test assemblies (with a Main method) without changing the source. As for debugging, I have found it very worthwhile to use the TestDriven.Net add-in's "Run Test With... Debugger" option. I understand it may take some effort to convince your team that this is a better way but perhaps you can produce a compelling demo for this. There will be no more main methods and no more redundant standalone test assemblies. I assume you are using Visual Studio. If you are using another IDE, let me know. Perhaps the simplest demo would be to take some arbitrary test, add a breakpoint right-click on it in the source editor, and run it with the debugger... very smooth. Then you can compile your test assemblies as ordinary class libraries with no Main methods in them at all... Jeff.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Leonid Lastovkin Sent: Friday, October 12, 2007 2:37 PM To: [email protected] Subject: MbUnit How to exclude Main methods from test run. Hi, Is there a way to instruct MbUnit to not treat Main methods as tests? Ideally I'd like to place an attribute such as [Skip] in front of every Main method which won't prevent it to function as expected outside of MbUnit. My co-workers often need to step through the tests they write in the debugger. Many choose to create a class with a main method which calls the "Constructor, Init, Test1, Destroy, Init, test2, Destroy, ..." sequence. They often check in those classes, which adds redundant information to the results of a nightly test run. Even if there is a better way to debug the tests, it won't be easy for me to convince them. The project with tests compiles as a stand-alone executable, so, if there exists some sort of a switch, I would have to do it in code (not as a command-line argument). I've heard that I can write my own MbUnit attribute. To do that, would I have to modify the source code of MbUnit, or can I just use the installed binary version and add customization on top of it? If I have to modify the source, then where can I get it? I looked for it several weeks ago and could not find anything. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MbUnit.User" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/MbUnitUser?hl=en -~----------~----~----~----~------~----~------~--~---
