forked from PowerShell/DscResource.Tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMicrosoft.PowerShellModuleKit.cs
More file actions
42 lines (36 loc) · 1.35 KB
/
Microsoft.PowerShellModuleKit.cs
File metadata and controls
42 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Custom Attribute for determining the order a test should run in, and also
// if the test will run in a container.
//
// It is used to decorate a .Tests.ps1 PowerShell script file that contains
// either unit tests or integration tests for a PowerShell module.
//
// The following are examples of how to write the decoration in a .Tests.ps1 file.
//
// # Integration test using container and specific order.
// [Microsoft.PowerShellModuleKit.IntegrationTest(OrderNumber = 1, ContainerName = 'ContainerName', ContainerImage = 'Organization/ImageName:Tag')]
// param()
//
// # Unit test using container.
// [Microsoft.PowerShellModuleKit.UnitTest(ContainerName = 'ContainerName', ContainerImage = 'Organization/ImageName:Tag')]
// param()
using System;
namespace Microsoft.PowerShellModuleKit
{
// See the attribute guidelines at http://go.microsoft.com/fwlink/?LinkId=85236
[System.AttributeUsage(System.AttributeTargets.All, Inherited = false, AllowMultiple = true)]
public class Test : System.Attribute
{
public Test() {}
public string ContainerName { get; set; }
public string ContainerImage { get; set; }
}
public sealed class IntegrationTest : Test
{
public IntegrationTest() {}
public int OrderNumber { get; set; }
}
public sealed class UnitTest : Test
{
public UnitTest() {}
}
}