|
12 | 12 | // limitations under the License. |
13 | 13 | // ---------------------------------------------------------------------------------- |
14 | 14 |
|
15 | | -using Microsoft.Azure.ServiceManagement.Common.Models; |
16 | 15 | using Microsoft.WindowsAzure.Commands.ScenarioTest; |
17 | | -using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; |
18 | 16 | using Xunit; |
19 | 17 |
|
20 | 18 | namespace Microsoft.Azure.Commands.Insights.Test.ScenarioTests |
21 | 19 | { |
22 | | - public class AlertsTests : RMTestBase |
| 20 | + public class AlertsTests : MonitorTestRunner |
23 | 21 | { |
24 | | - public XunitTracingInterceptor _logger; |
25 | | - |
26 | | - public AlertsTests(Xunit.Abstractions.ITestOutputHelper output) |
| 22 | + public AlertsTests(Xunit.Abstractions.ITestOutputHelper output) : base(output) |
27 | 23 | { |
28 | | - _logger = new XunitTracingInterceptor(output); |
29 | | - XunitTracingInterceptor.AddToContext(_logger); |
30 | 24 | } |
31 | 25 |
|
32 | 26 | [Fact] |
33 | 27 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
34 | 28 | public void TestNewAzureRmAlertRuleWebhook() |
35 | 29 | { |
36 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-NewAzureRmAlertRuleWebhook"); |
| 30 | + TestRunner.RunTestScript("Test-NewAzureRmAlertRuleWebhook"); |
37 | 31 | } |
38 | 32 |
|
39 | 33 | [Fact] |
40 | 34 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
41 | 35 | public void TestNewAzureRmAlertRuleEmail() |
42 | 36 | { |
43 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-NewAzureRmAlertRuleEmail"); |
| 37 | + TestRunner.RunTestScript("Test-NewAzureRmAlertRuleEmail"); |
44 | 38 | } |
45 | 39 |
|
46 | 40 | [Fact] |
47 | 41 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
48 | 42 | public void TestAddAzureRmMetricAlertRule() |
49 | 43 | { |
50 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRule"); |
| 44 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRule"); |
51 | 45 | } |
52 | 46 |
|
53 | 47 | [Fact] |
54 | 48 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
55 | 49 | public void TestAddAzureRmWebtestAlertRule() |
56 | 50 | { |
57 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmWebtestAlertRule"); |
| 51 | + TestRunner.RunTestScript("Test-AddAzureRmWebtestAlertRule"); |
58 | 52 | } |
59 | 53 |
|
60 | 54 | [Fact] |
61 | 55 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
62 | 56 | public void TestGetAzureRmAlertRule() |
63 | 57 | { |
64 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-GetAzureRmAlertRule"); |
| 58 | + TestRunner.RunTestScript("Test-GetAzureRmAlertRule"); |
65 | 59 | } |
66 | 60 |
|
67 | 61 | [Fact] |
68 | 62 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
69 | 63 | public void TestGetAzureRmAlertRuleByName() |
70 | 64 | { |
71 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-GetAzureRmAlertRuleByName"); |
| 65 | + TestRunner.RunTestScript("Test-GetAzureRmAlertRuleByName"); |
72 | 66 | } |
73 | 67 |
|
74 | 68 | [Fact] |
75 | 69 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
76 | 70 | public void TestRemoveAzureRmAlertRule() |
77 | 71 | { |
78 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-RemoveAzureRmAlertRule"); |
| 72 | + TestRunner.RunTestScript("Test-RemoveAzureRmAlertRule"); |
79 | 73 | } |
80 | 74 |
|
81 | 75 | [Fact] |
82 | 76 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
83 | 77 | public void TestGetAzureRmAlertHistory() |
84 | 78 | { |
85 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-GetAzureRmAlertHistory"); |
| 79 | + TestRunner.RunTestScript("Test-GetAzureRmAlertHistory"); |
86 | 80 | } |
87 | 81 |
|
88 | 82 | [Fact] |
89 | 83 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
90 | 84 | public void TestGetAzureRmMetricAlertRuleV2() |
91 | 85 | { |
92 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-GetAzureRmMetricAlertRuleV2"); |
| 86 | + TestRunner.RunTestScript("Test-GetAzureRmMetricAlertRuleV2"); |
93 | 87 | } |
94 | 88 |
|
95 | 89 | [Fact] |
96 | 90 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
97 | 91 | public void TestRemoveAzureRmMetricAlertRuleV2() |
98 | 92 | { |
99 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-RemoveAzureRmAlertRuleV2"); |
| 93 | + TestRunner.RunTestScript("Test-RemoveAzureRmAlertRuleV2"); |
100 | 94 | } |
101 | 95 |
|
102 | 96 | [Fact] |
103 | 97 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
104 | 98 | public void TestAddAzureRmMetricAlertRuleV2() |
105 | 99 | { |
106 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2"); |
| 100 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2"); |
107 | 101 | } |
108 | 102 |
|
109 | 103 | [Fact] |
110 | 104 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
111 | 105 | public void TestAddAzureRmMetricAlertRuleV2WithoutActionGroup() |
112 | 106 | { |
113 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-NoActionGroup"); |
| 107 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2-NoActionGroup"); |
114 | 108 | } |
115 | 109 |
|
116 | 110 | [Fact] |
117 | 111 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
118 | 112 | public void TestAddAzureRmMetricAlertRuleV2WithActionGroupId() |
119 | 113 | { |
120 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-ActionGroupId"); |
| 114 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2-ActionGroupId"); |
121 | 115 | } |
122 | 116 |
|
123 | 117 | [Fact] |
124 | 118 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
125 | 119 | public void TestAddAzureRmMetricAlertRuleV2WithSkipMetricValidation() |
126 | 120 | { |
127 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-SkipMetricValidation"); |
| 121 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2-SkipMetricValidation"); |
128 | 122 | } |
129 | 123 |
|
130 | 124 | [Fact] |
131 | 125 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
132 | 126 | public void TestAddAzureRmMetricAlertRuleV2WithAutoMitigate() |
133 | 127 | { |
134 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-autoMitigate"); |
| 128 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2-autoMitigate"); |
135 | 129 | } |
136 | 130 |
|
137 | 131 | [Fact] |
138 | 132 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
139 | 133 | public void TestDisableAzureRmMetricAlertRuleV2WithActionGroups() |
140 | 134 | { |
141 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-DisableAzureRmMetricAlertRuleV2WithActionGroups"); |
| 135 | + TestRunner.RunTestScript("Test-DisableAzureRmMetricAlertRuleV2WithActionGroups"); |
142 | 136 | } |
143 | 137 |
|
144 | 138 | [Fact] |
145 | 139 | [Trait(Category.AcceptanceType, Category.CheckIn)] |
146 | 140 | public void TestAddAzureRmDynamicMetricAlertRuleV2() |
147 | 141 | { |
148 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-DynamicThreshold"); |
| 142 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2-DynamicThreshold"); |
149 | 143 | } |
150 | 144 |
|
151 | 145 | [Fact] |
152 | 146 | [Trait(Category.AcceptanceType, Category.LiveOnly)] |
153 | 147 | public void TestAddAzureRmWebtestAlertRuleV2() |
154 | 148 | { |
155 | | - TestsController.NewInstance.RunPsTest(_logger, "Test-AddAzureRmMetricAlertRuleV2-Webtest"); |
| 149 | + TestRunner.RunTestScript("Test-AddAzureRmMetricAlertRuleV2-Webtest"); |
156 | 150 | } |
157 | 151 | } |
158 | 152 | } |
0 commit comments