Depending on the features you use, this can be trivial or complicated. You can use namespace / type aliases to use another class library to execute statements and attributes. I wrote console programs that run tests manually, but of course I had access to vs namespaces and assemblies.
For mono - my proposal it would be to use a different testing system as a whole, since doing it yourself using the system.reflection namespace to load the assembly, reflect the attributes and execute as you need will be tiring.
For instance:
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
source
share