/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* TestCaseExtension Library, Copyright 2015 Bryan Chadwick *
* *
* FILE: .\TestCaseAttribute.cs *
* *
* This file is part of TestCaseExtension. *
* *
* TestCaseExtension is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation, either version *
* 3 of the License, or (at your option) any later version. *
* *
* TestCaseExtension is distributed in the hope that it will be useful,*
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with TestCaseExtension. *
* If not, see . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
using System;
namespace TestCaseExtension
{
/// TestMethod enhancement to run a method multiple times with different arguments.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class TestCaseAttribute : Attribute
{
/// Arguments for the specific testcase
public object[] TestArguments{ get; set; }
/// Human-readable description for the testcase, ignored by the implementation
public string Description { get; set; }
/// Create a TestCase with the given argument
public TestCaseAttribute(object testArgument)
{
TestArguments = new[] { testArgument };
}
/// Create a TestCase with the given two arguments
public TestCaseAttribute(object testArgument1, object testArgument2)
{
TestArguments = new[] { testArgument1, testArgument2 };
}
/// Create a TestCase with the given three arguments
public TestCaseAttribute(object testArgument1, object testArgument2, object testArgument3)
{
TestArguments = new[] { testArgument1, testArgument2, testArgument3 };
}
/// Create a TestCase with the given arguments
public TestCaseAttribute(params object[] testArguments)
{
TestArguments = testArguments;
}
}
}