Skip to content

Instantly share code, notes, and snippets.

@sholfen
Created July 12, 2015 10:15
Show Gist options
  • Save sholfen/513ed73ab68af578191e to your computer and use it in GitHub Desktop.
Save sholfen/513ed73ab68af578191e to your computer and use it in GitHub Desktop.
Attribute Class Tip: AttributeUsage
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AttributeTestConsoleApplication
{
class Program
{
static void Main(string[] args)
{
}
}
[AttributeUsage(AttributeTargets.Class)]
public class TestClassAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Property)]
public class TestPropertyAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Method)]
public class TestMethodAttribute : Attribute
{
}
[TestClass]
public class TestClass
{
[TestProperty]
public string Field1 { get; set; }
[TestMethod]
public void Foo()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment