Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StorageSyncTestRunner to replace TestController #18351

Merged
merged 2 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


using ScenarioTests;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -24,21 +23,14 @@ namespace StorageSyncTests
/// <summary>
/// Class CloudEndpointTests.
/// </summary>
public class CloudEndpointTests
public class CloudEndpointTests : StorageSyncTestRunner
{
/// <summary>
/// The logger
/// </summary>
private readonly XunitTracingInterceptor _logger;

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

/// <summary>
Expand All @@ -48,7 +40,7 @@ public CloudEndpointTests(ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCloudEndpoint()
{
TestController.NewInstance.RunPsTest(_logger, "Test-CloudEndpoint");
TestRunner.RunTestScript("Test-CloudEndpoint");
}

/// <summary>
Expand All @@ -58,7 +50,7 @@ public void TestCloudEndpoint()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewCloudEndpoint()
{
TestController.NewInstance.RunPsTest(_logger, "Test-NewCloudEndpoint");
TestRunner.RunTestScript("Test-NewCloudEndpoint");
}

/// <summary>
Expand All @@ -68,7 +60,7 @@ public void TestNewCloudEndpoint()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetCloudEndpoint()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetCloudEndpoint");
TestRunner.RunTestScript("Test-GetCloudEndpoint");
}

/// <summary>
Expand All @@ -78,7 +70,7 @@ public void TestGetCloudEndpoint()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetCloudEndpointParentObject()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetCloudEndpointParentObject");
TestRunner.RunTestScript("Test-GetCloudEndpointParentObject");
}

/// <summary>
Expand All @@ -88,7 +80,7 @@ public void TestGetCloudEndpointParentObject()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetCloudEndpointParentResourceId()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetCloudEndpointParentResourceId");
TestRunner.RunTestScript("Test-GetCloudEndpointParentResourceId");
}


Expand All @@ -99,7 +91,7 @@ public void TestGetCloudEndpointParentResourceId()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetCloudEndpoints()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetCloudEndpoints");
TestRunner.RunTestScript("Test-GetCloudEndpoints");
}

/// <summary>
Expand All @@ -109,7 +101,7 @@ public void TestGetCloudEndpoints()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveCloudEndpoint()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveCloudEndpoint");
TestRunner.RunTestScript("Test-RemoveCloudEndpoint");
}

/// <summary>
Expand All @@ -119,7 +111,7 @@ public void TestRemoveCloudEndpoint()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveCloudEndpointResourceId()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveCloudEndpointResourceId");
TestRunner.RunTestScript("Test-RemoveCloudEndpointResourceId");
}

/// <summary>
Expand All @@ -129,7 +121,7 @@ public void TestRemoveCloudEndpointResourceId()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveCloudEndpointInputObject()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveCloudEndpointInputObject");
TestRunner.RunTestScript("Test-RemoveCloudEndpointInputObject");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// ----------------------------------------------------------------------------------


using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using ScenarioTests;
Expand All @@ -25,20 +24,14 @@ namespace StorageSyncTests
/// <summary>
/// Class RegisteredServerTests.
/// </summary>
public class RegisteredServerTests
public class RegisteredServerTests : StorageSyncTestRunner
{
/// <summary>
/// The logger
/// </summary>
private readonly XunitTracingInterceptor _logger;

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

/// <summary>
Expand All @@ -48,7 +41,7 @@ public RegisteredServerTests(ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRegisteredServer()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RegisteredServer");
TestRunner.RunTestScript("Test-RegisteredServer");
}

/// <summary>
Expand All @@ -58,7 +51,7 @@ public void TestRegisteredServer()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRegisteredServerPipeline1()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RegisteredServerPipeline1");
TestRunner.RunTestScript("Test-RegisteredServerPipeline1");
}

/// <summary>
Expand All @@ -68,7 +61,7 @@ public void TestRegisteredServerPipeline1()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRegisteredServerPipeline2()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RegisteredServerPipeline2");
TestRunner.RunTestScript("Test-RegisteredServerPipeline2");
}

/// <summary>
Expand All @@ -79,7 +72,7 @@ public void TestRegisteredServerPipeline2()
public void TestNewRegisteredServer()
{
var value = HttpMockServer.GetCurrentMode();
TestController.NewInstance.RunPsTest(_logger, "Test-NewRegisteredServer");
TestRunner.RunTestScript("Test-NewRegisteredServer");
}

/// <summary>
Expand All @@ -89,7 +82,7 @@ public void TestNewRegisteredServer()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewRegisteredServerParentObject()
{
TestController.NewInstance.RunPsTest(_logger, "Test-NewRegisteredServerParentObject");
TestRunner.RunTestScript("Test-NewRegisteredServerParentObject");
}

/// <summary>
Expand All @@ -99,7 +92,7 @@ public void TestNewRegisteredServerParentObject()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewRegisteredServerParentResourceId()
{
TestController.NewInstance.RunPsTest(_logger, "Test-NewRegisteredServerParentResourceId");
TestRunner.RunTestScript("Test-NewRegisteredServerParentResourceId");
}

/// <summary>
Expand All @@ -109,7 +102,7 @@ public void TestNewRegisteredServerParentResourceId()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetRegisteredServer()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetRegisteredServer");
TestRunner.RunTestScript("Test-GetRegisteredServer");
}

/// <summary>
Expand All @@ -119,7 +112,7 @@ public void TestGetRegisteredServer()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetRegisteredServerParentObject()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetRegisteredServerParentObject");
TestRunner.RunTestScript("Test-GetRegisteredServerParentObject");
}

/// <summary>
Expand All @@ -129,7 +122,7 @@ public void TestGetRegisteredServerParentObject()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetRegisteredServerParentResourceId()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetRegisteredServerParentResourceId");
TestRunner.RunTestScript("Test-GetRegisteredServerParentResourceId");
}

/// <summary>
Expand All @@ -139,7 +132,7 @@ public void TestGetRegisteredServerParentResourceId()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetRegisteredServers()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetRegisteredServers");
TestRunner.RunTestScript("Test-GetRegisteredServers");
}

/// <summary>
Expand All @@ -149,7 +142,7 @@ public void TestGetRegisteredServers()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveRegisteredServer()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveRegisteredServer");
TestRunner.RunTestScript("Test-RemoveRegisteredServer");
}

/// <summary>
Expand All @@ -159,7 +152,7 @@ public void TestRemoveRegisteredServer()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveRegisteredServerResourceId()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveRegisteredServerResourceId");
TestRunner.RunTestScript("Test-RemoveRegisteredServerResourceId");
}

/// <summary>
Expand All @@ -169,7 +162,7 @@ public void TestRemoveRegisteredServerResourceId()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveRegisteredServerInputObject()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveRegisteredServerInputObject");
TestRunner.RunTestScript("Test-RemoveRegisteredServerInputObject");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


using ScenarioTests;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -24,20 +23,14 @@ namespace StorageSyncTests
/// <summary>
/// Class ServerEndpointTests.
/// </summary>
public class ServerEndpointTests
public class ServerEndpointTests : StorageSyncTestRunner
{
/// <summary>
/// The logger
/// </summary>
private readonly XunitTracingInterceptor _logger;

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

/// <summary>
Expand All @@ -47,7 +40,7 @@ public ServerEndpointTests(ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerEndpoint()
{
TestController.NewInstance.RunPsTest(_logger, "Test-ServerEndpoint");
TestRunner.RunTestScript("Test-ServerEndpoint");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


using ScenarioTests;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -24,20 +23,14 @@ namespace StorageSyncTests
/// <summary>
/// Class StorageSyncServiceTests.
/// </summary>
public class StorageSyncServiceTests
public class StorageSyncServiceTests : StorageSyncTestRunner
{
/// <summary>
/// The logger
/// </summary>
private readonly XunitTracingInterceptor _logger;

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

/// <summary>
Expand All @@ -47,7 +40,7 @@ public StorageSyncServiceTests(ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestStorageSyncService()
{
TestController.NewInstance.RunPsTest(_logger, "Test-StorageSyncService");
TestRunner.RunTestScript("Test-StorageSyncService");
}

/// <summary>
Expand All @@ -57,7 +50,7 @@ public void TestStorageSyncService()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewStorageSyncService()
{
TestController.NewInstance.RunPsTest(_logger, "Test-NewStorageSyncService");
TestRunner.RunTestScript("Test-NewStorageSyncService");
}

/// <summary>
Expand All @@ -67,7 +60,7 @@ public void TestNewStorageSyncService()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetStorageSyncService()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetStorageSyncService");
TestRunner.RunTestScript("Test-GetStorageSyncService");
}

/// <summary>
Expand All @@ -77,7 +70,7 @@ public void TestGetStorageSyncService()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetStorageSyncServices()
{
TestController.NewInstance.RunPsTest(_logger, "Test-GetStorageSyncServices");
TestRunner.RunTestScript("Test-GetStorageSyncServices");
}

/// <summary>
Expand All @@ -87,7 +80,7 @@ public void TestGetStorageSyncServices()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveStorageSyncService()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveStorageSyncService");
TestRunner.RunTestScript("Test-RemoveStorageSyncService");
}

/// <summary>
Expand All @@ -97,7 +90,7 @@ public void TestRemoveStorageSyncService()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveStorageSyncServiceInputObject()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveStorageSyncServiceInputObject");
TestRunner.RunTestScript("Test-RemoveStorageSyncServiceInputObject");
}

/// <summary>
Expand All @@ -107,7 +100,7 @@ public void TestRemoveStorageSyncServiceInputObject()
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRemoveStorageSyncServiceResourceId()
{
TestController.NewInstance.RunPsTest(_logger, "Test-RemoveStorageSyncServiceResourceId");
TestRunner.RunTestScript("Test-RemoveStorageSyncServiceResourceId");
}

}
Expand Down
Loading