Skip to content

Commit 317efe4

Browse files
Add LogicAppTestRunner and replace Controller (#18150)
* Add LogicAppTestRunner and replace Controller * restore unit tests
1 parent 227d92a commit 317efe4

15 files changed

+147
-304
lines changed

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountAgreementTests.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,15 @@
1515
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
1616
{
1717
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18-
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19-
using ServiceManagement.Common.Models;
2018
using Xunit;
2119

2220
/// <summary>
2321
/// Scenario tests for integration account agreement commands.
2422
/// </summary>
25-
public class IntegrationAccountAgreementTests : RMTestBase
23+
public class IntegrationAccountAgreementTests : LogicAppTestRunner
2624
{
27-
public XunitTracingInterceptor _logger;
28-
29-
public IntegrationAccountAgreementTests(Xunit.Abstractions.ITestOutputHelper output)
25+
public IntegrationAccountAgreementTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
3026
{
31-
_logger = new XunitTracingInterceptor(output);
32-
XunitTracingInterceptor.AddToContext(_logger);
3327
}
3428

3529
/// <summary>
@@ -39,7 +33,7 @@ public IntegrationAccountAgreementTests(Xunit.Abstractions.ITestOutputHelper out
3933
[Trait(Category.AcceptanceType, Category.CheckIn)]
4034
public void TestCreateAgreementX12()
4135
{
42-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementX12");
36+
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementX12");
4337
}
4438

4539
/// <summary>
@@ -49,7 +43,7 @@ public void TestCreateAgreementX12()
4943
[Trait(Category.AcceptanceType, Category.CheckIn)]
5044
public void TestCreateAgreementWithFailure()
5145
{
52-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementWithFailure");
46+
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementWithFailure");
5347
}
5448

5549
/// <summary>
@@ -59,7 +53,7 @@ public void TestCreateAgreementWithFailure()
5953
[Trait(Category.AcceptanceType, Category.CheckIn)]
6054
public void TestCreateAgreementAs2()
6155
{
62-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementAS2");
56+
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementAS2");
6357
}
6458

6559
/// <summary>
@@ -69,7 +63,7 @@ public void TestCreateAgreementAs2()
6963
[Trait(Category.AcceptanceType, Category.CheckIn)]
7064
public void TestCreateAgreementEdifact()
7165
{
72-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementEdifact");
66+
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementEdifact");
7367
}
7468

7569
/// <summary>
@@ -79,7 +73,7 @@ public void TestCreateAgreementEdifact()
7973
[Trait(Category.AcceptanceType, Category.CheckIn)]
8074
public void TestGetAgreement()
8175
{
82-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountAgreement");
76+
TestRunner.RunTestScript("Test-GetIntegrationAccountAgreement");
8377
}
8478

8579
/// <summary>
@@ -89,7 +83,7 @@ public void TestGetAgreement()
8983
[Trait(Category.AcceptanceType, Category.CheckIn)]
9084
public void TestRemoveAgreement()
9185
{
92-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountAgreement");
86+
TestRunner.RunTestScript("Test-RemoveIntegrationAccountAgreement");
9387
}
9488

9589
/// <summary>
@@ -99,7 +93,7 @@ public void TestRemoveAgreement()
9993
[Trait(Category.AcceptanceType, Category.CheckIn)]
10094
public void TestUpdateAgreement()
10195
{
102-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateIntegrationAccountAgreement");
96+
TestRunner.RunTestScript("Test-UpdateIntegrationAccountAgreement");
10397
}
10498

10599
/// <summary>
@@ -109,7 +103,7 @@ public void TestUpdateAgreement()
109103
[Trait(Category.AcceptanceType, Category.CheckIn)]
110104
public void TestListAgreement()
111105
{
112-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-ListIntegrationAccountAgreement");
106+
TestRunner.RunTestScript("Test-ListIntegrationAccountAgreement");
113107
}
114108
}
115109
}

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountAssemblyTests.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,16 @@
1313
// ----------------------------------------------------------------------------------
1414
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
1515
{
16-
using Microsoft.Azure.ServiceManagement.Common.Models;
1716
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18-
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
1917
using Xunit;
2018

2119
/// <summary>
2220
/// Scenario tests for integration account assembly commands.
2321
/// </summary>
24-
public class IntegrationAccountAssemblyTests : RMTestBase
22+
public class IntegrationAccountAssemblyTests : LogicAppTestRunner
2523
{
26-
public XunitTracingInterceptor _logger;
27-
public IntegrationAccountAssemblyTests(Xunit.Abstractions.ITestOutputHelper output)
24+
public IntegrationAccountAssemblyTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
2825
{
29-
_logger = new XunitTracingInterceptor(output);
30-
XunitTracingInterceptor.AddToContext(_logger);
3126
}
3227

3328
/// <summary>
@@ -37,7 +32,7 @@ public IntegrationAccountAssemblyTests(Xunit.Abstractions.ITestOutputHelper outp
3732
[Trait(Category.AcceptanceType, Category.CheckIn)]
3833
public void TestNewAssembly()
3934
{
40-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-NewIntegrationAccountAssembly");
35+
TestRunner.RunTestScript("Test-NewIntegrationAccountAssembly");
4136
}
4237

4338
/// <summary>
@@ -47,7 +42,7 @@ public void TestNewAssembly()
4742
[Trait(Category.AcceptanceType, Category.CheckIn)]
4843
public void TestGetAssembly()
4944
{
50-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountAssembly");
45+
TestRunner.RunTestScript("Test-GetIntegrationAccountAssembly");
5146
}
5247

5348
/// <summary>
@@ -57,7 +52,7 @@ public void TestGetAssembly()
5752
[Trait(Category.AcceptanceType, Category.CheckIn)]
5853
public void TestRemoveAssembly()
5954
{
60-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountAssembly");
55+
TestRunner.RunTestScript("Test-RemoveIntegrationAccountAssembly");
6156
}
6257

6358
/// <summary>
@@ -67,7 +62,7 @@ public void TestRemoveAssembly()
6762
[Trait(Category.AcceptanceType, Category.CheckIn)]
6863
public void TestSetAssembly()
6964
{
70-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-SetIntegrationAccountAssembly");
65+
TestRunner.RunTestScript("Test-SetIntegrationAccountAssembly");
7166
}
7267
}
7368
}

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountBatchConfigurationTests.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,16 @@
1414

1515
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
1616
{
17-
using Microsoft.Azure.ServiceManagement.Common.Models;
1817
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19-
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
2018
using Xunit;
2119

2220
/// <summary>
2321
/// Scenario tests for integration account batch configuration commands.
2422
/// </summary>
25-
public class IntegrationAccountBatchConfigurationTests : RMTestBase
23+
public class IntegrationAccountBatchConfigurationTests : LogicAppTestRunner
2624
{
27-
public XunitTracingInterceptor _logger;
28-
public IntegrationAccountBatchConfigurationTests(Xunit.Abstractions.ITestOutputHelper output)
25+
public IntegrationAccountBatchConfigurationTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
2926
{
30-
_logger = new XunitTracingInterceptor(output);
31-
XunitTracingInterceptor.AddToContext(_logger);
3227
}
3328

3429
/// <summary>
@@ -38,7 +33,7 @@ public IntegrationAccountBatchConfigurationTests(Xunit.Abstractions.ITestOutputH
3833
[Trait(Category.AcceptanceType, Category.CheckIn)]
3934
public void TestNewBatchConfiguration()
4035
{
41-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-NewIntegrationAccountBatchConfiguration");
36+
TestRunner.RunTestScript("Test-NewIntegrationAccountBatchConfiguration");
4237
}
4338

4439
/// <summary>
@@ -48,7 +43,7 @@ public void TestNewBatchConfiguration()
4843
[Trait(Category.AcceptanceType, Category.CheckIn)]
4944
public void TestGetBatchConfiguration()
5045
{
51-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountBatchConfiguration");
46+
TestRunner.RunTestScript("Test-GetIntegrationAccountBatchConfiguration");
5247
}
5348

5449
/// <summary>
@@ -58,7 +53,7 @@ public void TestGetBatchConfiguration()
5853
[Trait(Category.AcceptanceType, Category.CheckIn)]
5954
public void TestRemoveBatchConfiguration()
6055
{
61-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountBatchConfiguration");
56+
TestRunner.RunTestScript("Test-RemoveIntegrationAccountBatchConfiguration");
6257
}
6358

6459
/// <summary>
@@ -68,7 +63,7 @@ public void TestRemoveBatchConfiguration()
6863
[Trait(Category.AcceptanceType, Category.CheckIn)]
6964
public void TestSetBatchConfiguration()
7065
{
71-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-SetIntegrationAccountBatchConfiguration");
66+
TestRunner.RunTestScript("Test-SetIntegrationAccountBatchConfiguration");
7267
}
7368
}
7469
}

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountCertificateTests.cs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,15 @@
1515
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
1616
{
1717
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18-
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19-
using ServiceManagement.Common.Models;
2018
using Xunit;
2119

2220
/// <summary>
2321
/// Scenario tests for integration account certificate commands.
2422
/// </summary>
25-
public class IntegrationAccountCertificateTests : RMTestBase
23+
public class IntegrationAccountCertificateTests : LogicAppTestRunner
2624
{
27-
public XunitTracingInterceptor _logger;
28-
29-
public IntegrationAccountCertificateTests(Xunit.Abstractions.ITestOutputHelper output)
25+
public IntegrationAccountCertificateTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
3026
{
31-
_logger = new XunitTracingInterceptor(output);
32-
XunitTracingInterceptor.AddToContext(_logger);
3327
}
3428

3529
/// <summary>
@@ -39,7 +33,7 @@ public IntegrationAccountCertificateTests(Xunit.Abstractions.ITestOutputHelper o
3933
[Trait(Category.AcceptanceType, Category.CheckIn)]
4034
public void TestCreateCertificate()
4135
{
42-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountCertificate");
36+
TestRunner.RunTestScript("Test-CreateIntegrationAccountCertificate");
4337
}
4438

4539
/// <summary>
@@ -49,7 +43,7 @@ public void TestCreateCertificate()
4943
[Trait(Category.AcceptanceType, Category.CheckIn)]
5044
public void TestCreateCertificatePrivateKey()
5145
{
52-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountCertificatePrivateKey");
46+
TestRunner.RunTestScript("Test-CreateIntegrationAccountCertificatePrivateKey");
5347
}
5448

5549
/// <summary>
@@ -59,7 +53,7 @@ public void TestCreateCertificatePrivateKey()
5953
[Trait(Category.AcceptanceType, Category.CheckIn)]
6054
public void TestGetCertificate()
6155
{
62-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountCertificate");
56+
TestRunner.RunTestScript("Test-GetIntegrationAccountCertificate");
6357
}
6458

6559
/// <summary>
@@ -69,7 +63,7 @@ public void TestGetCertificate()
6963
[Trait(Category.AcceptanceType, Category.CheckIn)]
7064
public void TestRemoveCertificate()
7165
{
72-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountCertificate");
66+
TestRunner.RunTestScript("Test-RemoveIntegrationAccountCertificate");
7367
}
7468

7569
/// <summary>
@@ -79,7 +73,7 @@ public void TestRemoveCertificate()
7973
[Trait(Category.AcceptanceType, Category.CheckIn)]
8074
public void TestUpdateCertificate()
8175
{
82-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateIntegrationAccountCertificate");
76+
TestRunner.RunTestScript("Test-UpdateIntegrationAccountCertificate");
8377
}
8478

8579
/// <summary>
@@ -89,7 +83,7 @@ public void TestUpdateCertificate()
8983
[Trait(Category.AcceptanceType, Category.CheckIn)]
9084
public void TestCreateCertificatePublicKey()
9185
{
92-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountCertificatePublicKey");
86+
TestRunner.RunTestScript("Test-CreateIntegrationAccountCertificatePublicKey");
9387
}
9488
}
9589
}

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountGeneratedIcnTests.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,15 @@
1515
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
1616
{
1717
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18-
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19-
using ServiceManagement.Common.Models;
2018
using Xunit;
2119

2220
/// <summary>
2321
/// Scenario tests for integration account generated control number commands.
2422
/// </summary>
25-
public class IntegrationAccountGeneratedIcnTests : RMTestBase
23+
public class IntegrationAccountGeneratedIcnTests : LogicAppTestRunner
2624
{
27-
public XunitTracingInterceptor _logger;
28-
29-
public IntegrationAccountGeneratedIcnTests(Xunit.Abstractions.ITestOutputHelper output)
25+
public IntegrationAccountGeneratedIcnTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
3026
{
31-
_logger = new XunitTracingInterceptor(output);
32-
XunitTracingInterceptor.AddToContext(_logger);
3327
}
3428

3529
/// <summary>
@@ -39,7 +33,7 @@ public IntegrationAccountGeneratedIcnTests(Xunit.Abstractions.ITestOutputHelper
3933
[Trait(Category.AcceptanceType, Category.CheckIn)]
4034
public void TestGetGeneratedIcn()
4135
{
42-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetGeneratedControlNumber");
36+
TestRunner.RunTestScript("Test-GetGeneratedControlNumber");
4337
}
4438

4539
/// <summary>
@@ -49,7 +43,7 @@ public void TestGetGeneratedIcn()
4943
[Trait(Category.AcceptanceType, Category.CheckIn)]
5044
public void TestUpdateGeneratedIcn()
5145
{
52-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateGeneratedControlNumber");
46+
TestRunner.RunTestScript("Test-UpdateGeneratedControlNumber");
5347
}
5448

5549
/// <summary>
@@ -59,7 +53,7 @@ public void TestUpdateGeneratedIcn()
5953
[Trait(Category.AcceptanceType, Category.CheckIn)]
6054
public void TestListGeneratedIcn()
6155
{
62-
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-ListGeneratedControlNumber");
56+
TestRunner.RunTestScript("Test-ListGeneratedControlNumber");
6357
}
6458
}
6559
}

0 commit comments

Comments
 (0)