Skip to content

Commit

Permalink
Add PeeringTestRunner to replace TestController (#18246)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-yuzhichen authored May 20, 2022
1 parent c08b6c0 commit dfd0739
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 355 deletions.
15 changes: 4 additions & 11 deletions src/Peering/Peering.Test/ScenarioTests/ConvertLegacyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@ namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests
/// <summary>
/// The get legacy tests.
/// </summary>
public class ConvertLegacyTests
public class ConvertLegacyTests : PeeringTestRunner
{
/// <summary>
/// The logger.
/// </summary>
private ServiceManagement.Common.Models.XunitTracingInterceptor logger;

/// <summary>
/// Initializes a new instance of the <see cref="GetLegacyTests"/> class.
/// </summary>
/// <param name="output">
/// The output.
/// </param>
public ConvertLegacyTests(Xunit.Abstractions.ITestOutputHelper output)
public ConvertLegacyTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
this.logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(this.logger);
}

/// <summary>
Expand All @@ -47,7 +40,7 @@ public ConvertLegacyTests(Xunit.Abstractions.ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestConvertLegacyKindExchangeAshburn()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-ConvertLegacyKindExchangeAshburn");
TestRunner.RunTestScript("Test-ConvertLegacyKindExchangeAshburn");
}

/// <summary>
Expand All @@ -57,7 +50,7 @@ public void TestConvertLegacyKindExchangeAshburn()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestConvertLegacyKindExchangeAmsterdamWithNewConnection()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-ConvertLegacyKindExchangeAmsterdamWithNewConnection");
TestRunner.RunTestScript("Test-ConvertLegacyKindExchangeAmsterdamWithNewConnection");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests
{
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;

using Xunit;
Expand All @@ -23,23 +22,16 @@ namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests
/// <summary>
/// The create new direct connection tests.
/// </summary>
public class CreateNewDirectConnectionTests
public class CreateNewDirectConnectionTests : PeeringTestRunner
{
/// <summary>
/// The logger.
/// </summary>
private XunitTracingInterceptor logger;

/// <summary>
/// Initializes a new instance of the <see cref="CreateNewDirectConnectionTests"/> class.
/// </summary>
/// <param name="output">
/// The output.
/// </param>
public CreateNewDirectConnectionTests(ITestOutputHelper output)
public CreateNewDirectConnectionTests(ITestOutputHelper output) : base(output)
{
this.logger = new XunitTracingInterceptor(output);
XunitTracingInterceptor.AddToContext(this.logger);
}

/// <summary>
Expand All @@ -49,7 +41,7 @@ public CreateNewDirectConnectionTests(ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionHighBandwidth()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionHighBandwidth");
TestRunner.RunTestScript("Test-NewDirectConnectionHighBandwidth");
}

/// <summary>
Expand All @@ -59,7 +51,7 @@ public void TestNewDirectConnectionHighBandwidth()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionLowBandwidth()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionLowBandwidth");
TestRunner.RunTestScript("Test-NewDirectConnectionLowBandwidth");
}

/// <summary>
Expand All @@ -69,7 +61,7 @@ public void TestNewDirectConnectionLowBandwidth()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionNoSession()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionNoSession");
TestRunner.RunTestScript("Test-NewDirectConnectionNoSession");
}

/// <summary>
Expand All @@ -79,7 +71,7 @@ public void TestNewDirectConnectionNoSession()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithV4()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithV4");
TestRunner.RunTestScript("Test-NewDirectConnectionWithV4");
}

/// <summary>
Expand All @@ -89,7 +81,7 @@ public void TestNewDirectConnectionWithV4()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithV4V6()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithV4V6");
TestRunner.RunTestScript("Test-NewDirectConnectionWithV4V6");
}

/// <summary>
Expand All @@ -99,7 +91,7 @@ public void TestNewDirectConnectionWithV4V6()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithV6()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithV6");
TestRunner.RunTestScript("Test-NewDirectConnectionWithV6");
}

/// <summary>
Expand All @@ -109,7 +101,7 @@ public void TestNewDirectConnectionWithV6()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWrongV4()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWrongV4");
TestRunner.RunTestScript("Test-NewDirectConnectionWrongV4");
}

/// <summary>
Expand All @@ -119,7 +111,7 @@ public void TestNewDirectConnectionWrongV4()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWrongV6()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWrongV6");
TestRunner.RunTestScript("Test-NewDirectConnectionWrongV6");
}

/// <summary>
Expand All @@ -129,7 +121,7 @@ public void TestNewDirectConnectionWrongV6()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithMicrosoftSession()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithMicrosoftSession");
TestRunner.RunTestScript("Test-NewDirectConnectionWithMicrosoftSession");
}

/// <summary>
Expand All @@ -139,7 +131,7 @@ public void TestNewDirectConnectionWithMicrosoftSession()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithMicrosoftSessionWithPeeringService()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithMicrosoftSessionWithPeeringService");
TestRunner.RunTestScript("Test-NewDirectConnectionWithMicrosoftSessionWithPeeringService");
}

/// <summary>
Expand All @@ -149,7 +141,7 @@ public void TestNewDirectConnectionWithMicrosoftSessionWithPeeringService()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithMicrosoftSessionInvalidV4()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithMicrosoftSessionInvalidV4");
TestRunner.RunTestScript("Test-NewDirectConnectionWithMicrosoftSessionInvalidV4");
}

/// <summary>
Expand All @@ -159,7 +151,7 @@ public void TestNewDirectConnectionWithMicrosoftSessionInvalidV4()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithMicrosoftSessionInvalidV6()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithMicrosoftSessionInvalidV6");
TestRunner.RunTestScript("Test-NewDirectConnectionWithMicrosoftSessionInvalidV6");
}

/// <summary>
Expand All @@ -169,7 +161,7 @@ public void TestNewDirectConnectionWithMicrosoftSessionInvalidV6()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithNoPeeringFacility()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithNoPeeringFacility");
TestRunner.RunTestScript("Test-NewDirectConnectionWithNoPeeringFacility");
}

/// <summary>
Expand All @@ -179,7 +171,7 @@ public void TestNewDirectConnectionWithNoPeeringFacility()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithNoBgpSession()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithNoBgpSession");
TestRunner.RunTestScript("Test-NewDirectConnectionWithNoBgpSession");
}

/// <summary>
Expand All @@ -189,7 +181,7 @@ public void TestNewDirectConnectionWithNoBgpSession()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithMicrosoftIpProvidedAddress()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithMicrosoftIpProvidedAddress");
TestRunner.RunTestScript("Test-NewDirectConnectionWithMicrosoftIpProvidedAddress");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,23 @@

namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests
{
using System;
using Microsoft.WindowsAzure.Commands.ScenarioTest;

using Xunit;

/// <summary>
/// The create new peering tests.
/// </summary>
public class CreateNewDirectPeeringTests
public class CreateNewDirectPeeringTests : PeeringTestRunner
{
/// <summary>
/// The _logger.
/// </summary>
private ServiceManagement.Common.Models.XunitTracingInterceptor logger;

/// <summary>
/// Initializes a new instance of the <see cref="CreateNewDirectPeeringTests"/> class.
/// </summary>
/// <param name="output">
/// The output.
/// </param>
public CreateNewDirectPeeringTests(Xunit.Abstractions.ITestOutputHelper output)
public CreateNewDirectPeeringTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
this.logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(this.logger);

}

/// <summary>
Expand All @@ -49,7 +40,7 @@ public CreateNewDirectPeeringTests(Xunit.Abstractions.ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectPeering()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectPeering");
TestRunner.RunTestScript("Test-NewDirectPeering");
}

/// <summary>
Expand All @@ -59,7 +50,7 @@ public void TestNewDirectPeering()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectPeeringWithPipe()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectPeeringWithPipe");
TestRunner.RunTestScript("Test-NewDirectPeeringWithPipe");
}

/// <summary>
Expand All @@ -69,7 +60,7 @@ public void TestNewDirectPeeringWithPipe()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectPeeringPipeTwoConnections()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectPeeringPipeTwoConnections");
TestRunner.RunTestScript("Test-NewDirectPeeringPipeTwoConnections");
}

/// <summary>
Expand All @@ -79,7 +70,7 @@ public void TestNewDirectPeeringPipeTwoConnections()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectPeeringPremiumDirectFree()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectPeeringPremiumDirectFree");
TestRunner.RunTestScript("Test-NewDirectPeeringPremiumDirectFree");
}

/// <summary>
Expand All @@ -89,7 +80,7 @@ public void TestNewDirectPeeringPremiumDirectFree()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectPeeringPremiumDirectUnlimited()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectPeeringPremiumDirectUnlimited");
TestRunner.RunTestScript("Test-NewDirectPeeringPremiumDirectUnlimited");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,18 @@
namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;

using Xunit;

/// <summary>
/// The create new exchange connection tests.
/// </summary>
public class CreateNewExchangeConnectionTests
public class CreateNewExchangeConnectionTests : PeeringTestRunner
{
/// <summary>
/// The _logger.
/// </summary>
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;

/// <summary>
/// Initializes a new instance of the <see cref="CreateNewExchangeConnectionTests"/> class.
/// </summary>
/// <param name="output">
/// The output.
/// </param>
public CreateNewExchangeConnectionTests(Xunit.Abstractions.ITestOutputHelper output)
public CreateNewExchangeConnectionTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
this._logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(this._logger);
}

/// <summary>
Expand All @@ -47,7 +36,7 @@ public CreateNewExchangeConnectionTests(Xunit.Abstractions.ITestOutputHelper out
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewExchangeConnectionV4V6()
{
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewExchangeConnectionV4V6");
TestRunner.RunTestScript("Test-NewExchangeConnectionV4V6");
}

/// <summary>
Expand All @@ -57,7 +46,7 @@ public void TestNewExchangeConnectionV4V6()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewExchangeConnectionV4()
{
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewExchangeConnectionV4");
TestRunner.RunTestScript("Test-NewExchangeConnectionV4");
}

/// <summary>
Expand All @@ -67,7 +56,7 @@ public void TestNewExchangeConnectionV4()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewExchangeConnectionV6()
{
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewExchangeConnectionV6");
TestRunner.RunTestScript("Test-NewExchangeConnectionV6");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@ namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests
/// <summary>
/// The create new peering tests.
/// </summary>
public class CreateNewExchangePeeringTests
public class CreateNewExchangePeeringTests : PeeringTestRunner
{
/// <summary>
/// The _logger.
/// </summary>
private ServiceManagement.Common.Models.XunitTracingInterceptor logger;

/// <summary>
/// Initializes a new instance of the <see cref="CreateNewExchangePeeringTests"/> class.
/// </summary>
/// <param name="output">
/// The output.
/// </param>
public CreateNewExchangePeeringTests(Xunit.Abstractions.ITestOutputHelper output)
public CreateNewExchangePeeringTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
this.logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(this.logger);
}

/// <summary>
Expand All @@ -47,7 +40,7 @@ public CreateNewExchangePeeringTests(Xunit.Abstractions.ITestOutputHelper output
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewExchangePeering()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewExchangePeering");
TestRunner.RunTestScript("Test-NewExchangePeering");
}

/// <summary>
Expand All @@ -57,7 +50,7 @@ public void TestNewExchangePeering()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewExchangePeeringPipe()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewExchangePeeringPipe");
TestRunner.RunTestScript("Test-NewExchangePeeringPipe");
}
}
}
Loading

0 comments on commit dfd0739

Please sign in to comment.