A game about forced loneliness, made by TACStudios
1using System;
2using NUnit.Framework;
3using NUnit.Framework.Interfaces;
4using NUnit.Framework.Internal;
5
6namespace Unity.PerformanceTesting
7{
8 /// <summary>
9 /// Test attribute to specify test version.
10 /// </summary>
11 [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
12 public class VersionAttribute : NUnitAttribute, IApplyToTest
13 {
14 /// <summary>
15 /// Test version.
16 /// </summary>
17 public string Version { get; }
18
19 /// <summary>
20 /// Adds attribute to specify test version.
21 /// </summary>
22 /// <param name="version">Version of the test.</param>
23 public VersionAttribute(string version)
24 {
25 Version = version;
26 }
27
28 /// <summary>
29 /// Used by NUnit to apply version to properties.
30 /// </summary>
31 /// <param name="test">An NUnit test to apply the version property to.</param>
32 public void ApplyToTest(Test test)
33 {
34 test.Properties.Add("Version", this);
35 }
36 }
37}