Say you have some boiler plate using statements. Say something like this:
#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Category = Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestContext = System.Object;
#endif
(This is for my unit testing code) If I did not want to put that in the top of every file that has unit tests, is there a way to setup a level of indirection here?
I don't think this would work, but here is an example of what I am thinking of:
Make a file called NUnitCompatability.cs and put the above code in it. Then add using NUnitCompatability
to all my unit test files. This would work in Delphi, but not in C# (I think). But is there another way to get to this type of functionality?