Hello, I'm using VS2008 to develop a project that I'm starting to test under Mono. There are a number of unit tests written using the VS unit test framework, is there a tool that will let me run these in Mono?
Thanks,
Hello, I'm using VS2008 to develop a project that I'm starting to test under Mono. There are a number of unit tests written using the VS unit test framework, is there a tool that will let me run these in Mono?
Thanks,
Depending on the features that you're using it can be trivial or hard. You can use namespace/type aliasing to use another class library to do asserts, and the attributes. I've written console programs that run the tests manually - but of course I had access to the vs namespaces and assemblies.
For mono - my suggestion would be to use another testing system altogether as doing it yourself with system.reflection namepace to load the assembly, reflect the attributes and execute as you need to, will be tedious.
For example:
Pseudo code:
var assembly = loadAsembly(....)
foreach(type in assembly.types) {
if(type is static class and had method with AssemblyInitialiseAttrubute)){
InvokeTheMethod(method);
}
}
foreach(type in assembly.types) {
if(type is not class and had method with TestClass)){
InvokeTheMethod(method);
}
foreach(method in type with ClassinitialiseAttribute)
}
... etc