2

This may seem like a weird question, but it's actually not too crazy with my situation. I'm currently building a test framework that performs Selenium UI testing on a web platform, and all is working very well, but due to requirements, we ended up using two different frameworks together for our test suite; MbUnit and NUnit(MbUnit for parallelization, NUnit for native Visual Studio 2012 support).

There is nothing wrong with the two, they just use the same naming convention in their attributes, which has our tests decorated like this:

using NUnit.Framework;
using mbunit = MbUnit.Framework;

[TestFixture, mbunit::TestFixture, mbunit::ParallelizableAttribute]
public class MyTestFixture
{
    [Test, mbunit::Test]
    public void MyTest(){}
}

Once again, not bad or too annoying, but if it is possible I'd like a way to wrap the similar attributes into one attribute somehow. I know in ASP.Net MVC you can do dynamic Model Metadata magic, to combine verification attributes, but I didn't know if there was a way outside of MVC that would clean this up for those who end up writing Test Suites from our framework.

PS - I can wrap some of the MbUnit attributes in new attributes(turning the attribute from "mbunit::Test" to "Parallel"), but important attributes like SetUp are sealed to the MbUnit framework, which leaves us with "mbunit::SetUp" tags which, with the inconsistency, I feel is even more confusing then if we just left it the way it is.

PSS - PNunit was no good for our situation at this point...maybe as there becomes more documentation and a more seamless integration with NUnit, we could migrate pretty easily in the future.

DizWARE
  • 21
  • 2
  • Why not just use MbUnit for everything? And when you say "MbUnit for parallelization", what do you mean exactly? Perhaps this is a problem with your test runner, and not the test framework? – Lasse V. Karlsen Jul 18 '14 at 18:02
  • It is a problem with the test runner. We are low on options...I use Icarus, personally, which is MbUnit's GUI runner, but the requirements we were given required us to also support the Visual Studio test runner. MbUnit is only supported in Visual Studio 2010; they never finished adding support to 2012 before going into Hiatus. – DizWARE Jul 18 '14 at 18:06
  • Well, what do you mean by parallelization here? Does MbUnit do something magical or are you just talking about being able to run your tests in parallel? – Lasse V. Karlsen Jul 18 '14 at 18:12
  • MbUnit gives the functionality of launching multiple threads on one test run, allowing you to run test fixtures or even tests in a fixture in parallel with each other. There are other things that simulate this, but usually cost money and aren't nearly as elegant. Eventually this will sit on a server and when things get checked in it will launch the UI test within some server farm or possibly up on Browser Stack. All of that works already, very nicely because of MbUnit's framework. – DizWARE Jul 18 '14 at 18:32

1 Answers1

2

No, you can't.

It would involve something like multiple inheritance which neither C# or .NET supports.

Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825