Skip to content
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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.TestFx;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class DeviceProvisioningServicesTestRunner
{
protected readonly ITestRunner TestRunner;

protected DeviceProvisioningServicesTestRunner(ITestOutputHelper output)
{
TestRunner = TestManager.CreateInstance(output)
.WithNewPsScriptFilename($"{GetType().Name}.ps1")
.WithProjectSubfolderForTests("ScenarioTests")
.WithCommonPsScripts(new[]
{
"../AzureRM.Resources.ps1"
})
.WithNewRmModules(helper => new[]
{
helper.RMProfileModule,
helper.GetRMModulePath("Az.DeviceProvisioningServices.psd1"),
helper.GetRMModulePath("Az.IotHub.psd1")
})
.Build();
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsAccessPolicyTests : RMTestBase
public class IotDpsAccessPolicyTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void IotDpsAccessPolicyLifeCycle()
{
IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzureIotDpsAccessPolicyLifeCycle");
TestRunner.RunTestScript("Test-AzureIotDpsAccessPolicyLifeCycle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Commands.ScenarioTest;
using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsCertificateTests : RMTestBase
public class IotDpsCertificateTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact(Skip = "Access denied error on CertEnroll CX509 Enrollment CreateRequest")]
Expand All @@ -51,7 +44,7 @@ public void IotDpsCertificateLifeCycle()

AzureSession.Instance.DataStore = dataStore;

IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzureIotDpsCertificateLifeCycle");
TestRunner.RunTestScript("Test-AzureIotDpsCertificateLifeCycle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsEnrollmentGroupTests : RMTestBase
public class IotDpsEnrollmentGroupTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
public void IotDpsEnrollmentGroupLifeCycle()
{
IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzIotDpsEnrollmentGroupLifeCycle");
TestRunner.RunTestScript("Test-AzIotDpsEnrollmentGroupLifeCycle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsEnrollmentTests : RMTestBase
public class IotDpsEnrollmentTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
public void IotDpsEnrollmentLifeCycle()
{
IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzIotDpsEnrollmentLifeCycle");
TestRunner.RunTestScript("Test-AzIotDpsEnrollmentLifeCycle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsLinkedHubTests : RMTestBase
public class IotDpsLinkedHubTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void IotDpsLinkedHubLifeCycle()
{
IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzureIotDpsLinkedHubLifeCycle");
TestRunner.RunTestScript("Test-AzureIotDpsLinkedHubLifeCycle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsRegistrationTests : RMTestBase
public class IotDpsRegistrationTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
public void IotDpsRegistrationLifeCycle()
{
IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzIotDpsRegistrationLifeCycle");
TestRunner.RunTestScript("Test-AzIotDpsRegistrationLifeCycle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagement.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Commands.DeviceProvisioningServices.Test
{
public class IotDpsTests : RMTestBase
public class IotDpsTests : DeviceProvisioningServicesTestRunner
{
public XunitTracingInterceptor _logger;

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

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void IotDpsLifeCycle()
{
IotDpsController.NewInstance.RunPsTest(_logger, "Test-AzureIotDpsLifeCycle");
TestRunner.RunTestScript("Test-AzureIotDpsLifeCycle");
}
}
}