Skip to content

Commit 0836bde

Browse files
authored
Merge pull request #6023 from bgsky/preview
Upgrade parameters on Cmdlet Get-AzureRmConsumptionUsageDetail
2 parents 06b9652 + 35468ac commit 0836bde

28 files changed

+855
-939
lines changed

src/ResourceManager/Consumption/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Add new parameters Expand, ResourceGroup, InstanceName, InstanceId, Tags, and Top on Cmdlet Get-AzureRmConsumptionUsageDetail
2122

2223
## Version 0.3.2
2324
* Set minimum dependency of module to PowerShell 5.0

src/ResourceManager/Consumption/Commands.Consumption.Test/Commands.Consumption.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6363
<Private>True</Private>
6464
</Reference>
65-
<Reference Include="Microsoft.Azure.Management.Consumption, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
66-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.1.1.0-preview\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath>
65+
<Reference Include="Microsoft.Azure.Management.Consumption, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
66+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.3.0.0\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath>
6767
</Reference>
6868
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6969
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/Consumption/Commands.Consumption.Test/ScenarioTests/TestController.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
using Microsoft.Azure.Subscriptions;
2525
using Microsoft.Azure.Test;
2626
using Microsoft.Azure.Test.HttpRecorder;
27-
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2827
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2928
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
3029
using TestBase = Microsoft.Azure.Test.TestBase;
31-
using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
3230
using TestUtilities = Microsoft.Azure.Test.TestUtilities;
31+
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
3332

3433
namespace Microsoft.Azure.Commands.Consumption.Test.ScenarioTests.ScenarioTest
3534
{
@@ -78,12 +77,11 @@ protected void SetupManagementClients(MockContext context)
7877
ConsumptionManagementClient);
7978
}
8079

81-
public void RunPowerShellTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts)
80+
public void RunPowerShellTest(params string[] scripts)
8281
{
8382
var callingClassType = TestUtilities.GetCallingClass(2);
8483
var mockName = TestUtilities.GetCurrentMethodName(2);
8584

86-
_helper.TracingInterceptor = logger;
8785
RunPsTestWorkflow(
8886
() => scripts,
8987
// no custom initializer
@@ -179,7 +177,10 @@ private GalleryClient GetGalleryClient()
179177

180178
private ConsumptionManagementClient GetConsumptionManagementClient(MockContext context)
181179
{
182-
return context.GetServiceClient<ConsumptionManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
180+
return
181+
context.GetServiceClient<ConsumptionManagementClient>(
182+
new Rest.ClientRuntime.Azure.TestFramework.TestEnvironment(
183+
Environment.GetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION")));
183184
}
184185
}
185186
}

src/ResourceManager/Consumption/Commands.Consumption.Test/ScenarioTests/UsageDetailsTests.cs

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,81 +16,60 @@
1616
using Microsoft.Azure.Commands.ScenarioTest;
1717
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1818
using Xunit;
19+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
20+
using Xunit.Abstractions;
21+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
1922

2023
namespace Microsoft.Azure.Commands.Consumption.Test.ScenarioTests
2124
{
22-
public class UsageDetailsTests
25+
public class UsageDetailsTests : RMTestBase
2326
{
24-
private ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger;
25-
26-
public UsageDetailsTests(Xunit.Abstractions.ITestOutputHelper output)
27+
public UsageDetailsTests(ITestOutputHelper output)
2728
{
28-
_logger = new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output);
29-
ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
29+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
3030
TestExecutionHelpers.SetUpSessionAndProfile();
3131
}
3232

3333
[Fact]
3434
[Trait(Category.AcceptanceType, Category.CheckIn)]
3535
public void TestListUsageDetails()
3636
{
37-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListUsageDetails");
38-
}
39-
40-
[Fact]
41-
[Trait(Category.AcceptanceType, Category.CheckIn)]
42-
public void TestListUsageDetailsWithExpand()
43-
{
44-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListUsageDetailsWithExpand");
45-
}
46-
47-
[Fact]
48-
[Trait(Category.AcceptanceType, Category.CheckIn)]
49-
public void TestListUsageDetailsWithFilter()
50-
{
51-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListUsageDetailsWithFilter");
52-
}
53-
54-
[Fact]
55-
[Trait(Category.AcceptanceType, Category.CheckIn)]
56-
public void TestListInvoiceUsageDetails()
57-
{
58-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListInvoiceUsageDetails");
37+
TestController.NewInstance.RunPowerShellTest("Test-ListUsageDetails");
5938
}
6039

6140
[Fact]
6241
[Trait(Category.AcceptanceType, Category.CheckIn)]
63-
public void TestListInvoiceUsageDetailsWithExpand()
42+
public void TestListUsageDetailsWithMeterDetailsExpand()
6443
{
65-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListInvoiceUsageDetailsWithExpand");
44+
TestController.NewInstance.RunPowerShellTest("Test-ListUsageDetailsWithMeterDetailsExpand");
6645
}
6746

6847
[Fact]
6948
[Trait(Category.AcceptanceType, Category.CheckIn)]
70-
public void TestListInvoiceUsageDetailsWithFilter()
49+
public void TestListUsageDetailsWithDateFilter()
7150
{
72-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListInvoiceUsageDetailsWithFilter");
51+
TestController.NewInstance.RunPowerShellTest("Test-ListUsageDetailsWithDateFilter");
7352
}
7453

7554
[Fact]
7655
[Trait(Category.AcceptanceType, Category.CheckIn)]
7756
public void TestListBillingPeriodUsageDetails()
7857
{
79-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListBillingPeriodUsageDetails");
58+
TestController.NewInstance.RunPowerShellTest("Test-ListBillingPeriodUsageDetails");
8059
}
8160

8261
[Fact]
8362
[Trait(Category.AcceptanceType, Category.CheckIn)]
84-
public void TestListBillingPeriodUsageDetailsWithExpand()
63+
public void TestListBillingPeriodUsageDetailsWithFilterOnInstanceName()
8564
{
86-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListBillingPeriodUsageDetailsWithExpand");
65+
TestController.NewInstance.RunPowerShellTest("Test-ListBillingPeriodUsageDetailsWithFilterOnInstanceName");
8766
}
8867

8968
[Fact]
9069
[Trait(Category.AcceptanceType, Category.CheckIn)]
91-
public void TestListBillingPeriodUsageDetailsWithFilter()
70+
public void TestListBillingPeriodUsageDetailsWithDateFilter()
9271
{
93-
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListBillingPeriodUsageDetailsWithFilter");
72+
TestController.NewInstance.RunPowerShellTest("Test-ListBillingPeriodUsageDetailsWithDateFilter");
9473
}
9574

9675
}

0 commit comments

Comments
 (0)