Way to eliminate pre-processor commands
<p>I need a way to show this C# 3.0 code:</p>

<pre><code>[TestMethod]
#if NUNIT
        [Moled]
#else
        [HostType("Moles")]
#endif
public void TestSomething()
</code></pre>

<p>With out using/needing the pre-processor commands on each method.</p>

<p>Is this possible?</p>

<hr>

<p>Talking with a co-worker, we theorized that there may be a way to create an attribute class that has 2 constructors (one with zero params and one with 1 string). Then in the top of the file we do our conditional there like this:</p>

<pre><code>#if NUNIT
   Moled = MyNamespace.MyNewAttribute;
#else
   HostType = MyNamespace.MyNewAttribute;
#endif
</code></pre>

<p>The MyNewAttribute class would be setup to do nothing, so that I can compile with this:</p>

<pre><code>[TestMethod]
[Moled]
[HostType("Moles")]
public void TestSomething()
</code></pre>

<p>Would this work?  How would I write this class?</p>
