Skip to content

Commit

Permalink
Add LogicAppTestRunner and replace Controller (#18150)
Browse files Browse the repository at this point in the history
* Add LogicAppTestRunner and replace Controller

* restore unit tests
  • Loading branch information
CaptainFanZzz authored May 13, 2022
1 parent 227d92a commit 317efe4
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 304 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,15 @@
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using ServiceManagement.Common.Models;
using Xunit;

/// <summary>
/// Scenario tests for integration account agreement commands.
/// </summary>
public class IntegrationAccountAgreementTests : RMTestBase
public class IntegrationAccountAgreementTests : LogicAppTestRunner
{
public XunitTracingInterceptor _logger;

public IntegrationAccountAgreementTests(Xunit.Abstractions.ITestOutputHelper output)
public IntegrationAccountAgreementTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

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

/// <summary>
Expand All @@ -49,7 +43,7 @@ public void TestCreateAgreementX12()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateAgreementWithFailure()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementWithFailure");
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementWithFailure");
}

/// <summary>
Expand All @@ -59,7 +53,7 @@ public void TestCreateAgreementWithFailure()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateAgreementAs2()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementAS2");
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementAS2");
}

/// <summary>
Expand All @@ -69,7 +63,7 @@ public void TestCreateAgreementAs2()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateAgreementEdifact()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountAgreementEdifact");
TestRunner.RunTestScript("Test-CreateIntegrationAccountAgreementEdifact");
}

/// <summary>
Expand All @@ -79,7 +73,7 @@ public void TestCreateAgreementEdifact()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetAgreement()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountAgreement");
TestRunner.RunTestScript("Test-GetIntegrationAccountAgreement");
}

/// <summary>
Expand All @@ -89,7 +83,7 @@ public void TestGetAgreement()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveAgreement()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountAgreement");
TestRunner.RunTestScript("Test-RemoveIntegrationAccountAgreement");
}

/// <summary>
Expand All @@ -99,7 +93,7 @@ public void TestRemoveAgreement()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateAgreement()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateIntegrationAccountAgreement");
TestRunner.RunTestScript("Test-UpdateIntegrationAccountAgreement");
}

/// <summary>
Expand All @@ -109,7 +103,7 @@ public void TestUpdateAgreement()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListAgreement()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-ListIntegrationAccountAgreement");
TestRunner.RunTestScript("Test-ListIntegrationAccountAgreement");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@
// ----------------------------------------------------------------------------------
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
{
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;

/// <summary>
/// Scenario tests for integration account assembly commands.
/// </summary>
public class IntegrationAccountAssemblyTests : RMTestBase
public class IntegrationAccountAssemblyTests : LogicAppTestRunner
{
public XunitTracingInterceptor _logger;
public IntegrationAccountAssemblyTests(Xunit.Abstractions.ITestOutputHelper output)
public IntegrationAccountAssemblyTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

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

/// <summary>
Expand All @@ -47,7 +42,7 @@ public void TestNewAssembly()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetAssembly()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountAssembly");
TestRunner.RunTestScript("Test-GetIntegrationAccountAssembly");
}

/// <summary>
Expand All @@ -57,7 +52,7 @@ public void TestGetAssembly()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveAssembly()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountAssembly");
TestRunner.RunTestScript("Test-RemoveIntegrationAccountAssembly");
}

/// <summary>
Expand All @@ -67,7 +62,7 @@ public void TestRemoveAssembly()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSetAssembly()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-SetIntegrationAccountAssembly");
TestRunner.RunTestScript("Test-SetIntegrationAccountAssembly");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@

namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
{
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;

/// <summary>
/// Scenario tests for integration account batch configuration commands.
/// </summary>
public class IntegrationAccountBatchConfigurationTests : RMTestBase
public class IntegrationAccountBatchConfigurationTests : LogicAppTestRunner
{
public XunitTracingInterceptor _logger;
public IntegrationAccountBatchConfigurationTests(Xunit.Abstractions.ITestOutputHelper output)
public IntegrationAccountBatchConfigurationTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

/// <summary>
Expand All @@ -38,7 +33,7 @@ public IntegrationAccountBatchConfigurationTests(Xunit.Abstractions.ITestOutputH
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewBatchConfiguration()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-NewIntegrationAccountBatchConfiguration");
TestRunner.RunTestScript("Test-NewIntegrationAccountBatchConfiguration");
}

/// <summary>
Expand All @@ -48,7 +43,7 @@ public void TestNewBatchConfiguration()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetBatchConfiguration()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountBatchConfiguration");
TestRunner.RunTestScript("Test-GetIntegrationAccountBatchConfiguration");
}

/// <summary>
Expand All @@ -58,7 +53,7 @@ public void TestGetBatchConfiguration()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveBatchConfiguration()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountBatchConfiguration");
TestRunner.RunTestScript("Test-RemoveIntegrationAccountBatchConfiguration");
}

/// <summary>
Expand All @@ -68,7 +63,7 @@ public void TestRemoveBatchConfiguration()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSetBatchConfiguration()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-SetIntegrationAccountBatchConfiguration");
TestRunner.RunTestScript("Test-SetIntegrationAccountBatchConfiguration");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,15 @@
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using ServiceManagement.Common.Models;
using Xunit;

/// <summary>
/// Scenario tests for integration account certificate commands.
/// </summary>
public class IntegrationAccountCertificateTests : RMTestBase
public class IntegrationAccountCertificateTests : LogicAppTestRunner
{
public XunitTracingInterceptor _logger;

public IntegrationAccountCertificateTests(Xunit.Abstractions.ITestOutputHelper output)
public IntegrationAccountCertificateTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

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

/// <summary>
Expand All @@ -49,7 +43,7 @@ public void TestCreateCertificate()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateCertificatePrivateKey()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountCertificatePrivateKey");
TestRunner.RunTestScript("Test-CreateIntegrationAccountCertificatePrivateKey");
}

/// <summary>
Expand All @@ -59,7 +53,7 @@ public void TestCreateCertificatePrivateKey()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetCertificate()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetIntegrationAccountCertificate");
TestRunner.RunTestScript("Test-GetIntegrationAccountCertificate");
}

/// <summary>
Expand All @@ -69,7 +63,7 @@ public void TestGetCertificate()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveCertificate()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-RemoveIntegrationAccountCertificate");
TestRunner.RunTestScript("Test-RemoveIntegrationAccountCertificate");
}

/// <summary>
Expand All @@ -79,7 +73,7 @@ public void TestRemoveCertificate()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateCertificate()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateIntegrationAccountCertificate");
TestRunner.RunTestScript("Test-UpdateIntegrationAccountCertificate");
}

/// <summary>
Expand All @@ -89,7 +83,7 @@ public void TestUpdateCertificate()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateCertificatePublicKey()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-CreateIntegrationAccountCertificatePublicKey");
TestRunner.RunTestScript("Test-CreateIntegrationAccountCertificatePublicKey");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,15 @@
namespace Microsoft.Azure.Commands.LogicApp.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using ServiceManagement.Common.Models;
using Xunit;

/// <summary>
/// Scenario tests for integration account generated control number commands.
/// </summary>
public class IntegrationAccountGeneratedIcnTests : RMTestBase
public class IntegrationAccountGeneratedIcnTests : LogicAppTestRunner
{
public XunitTracingInterceptor _logger;

public IntegrationAccountGeneratedIcnTests(Xunit.Abstractions.ITestOutputHelper output)
public IntegrationAccountGeneratedIcnTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
_logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(_logger);
}

/// <summary>
Expand All @@ -39,7 +33,7 @@ public IntegrationAccountGeneratedIcnTests(Xunit.Abstractions.ITestOutputHelper
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetGeneratedIcn()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-GetGeneratedControlNumber");
TestRunner.RunTestScript("Test-GetGeneratedControlNumber");
}

/// <summary>
Expand All @@ -49,7 +43,7 @@ public void TestGetGeneratedIcn()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateGeneratedIcn()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateGeneratedControlNumber");
TestRunner.RunTestScript("Test-UpdateGeneratedControlNumber");
}

/// <summary>
Expand All @@ -59,7 +53,7 @@ public void TestUpdateGeneratedIcn()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListGeneratedIcn()
{
WorkflowController.NewInstance.RunPowerShellTest(_logger, "Test-ListGeneratedControlNumber");
TestRunner.RunTestScript("Test-ListGeneratedControlNumber");
}
}
}
Loading

0 comments on commit 317efe4

Please sign in to comment.