Skip to content

Upgrade parameters on Cmdlet Get-AzureRmConsumptionUsageDetail #6023

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

Merged
merged 14 commits into from
May 9, 2018
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
1 change: 1 addition & 0 deletions src/ResourceManager/Consumption/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Add new parameters Expand, ResourceGroup, InstanceName, InstanceId, Tags, and Top on Cmdlet Get-AzureRmConsumptionUsageDetail

## Version 0.3.2
* Set minimum dependency of module to PowerShell 5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Consumption, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.1.1.0-preview\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.Consumption, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Consumption.3.0.0\lib\net452\Microsoft.Azure.Management.Consumption.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@
using Microsoft.Azure.Subscriptions;
using Microsoft.Azure.Test;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using TestBase = Microsoft.Azure.Test.TestBase;
using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
using TestUtilities = Microsoft.Azure.Test.TestUtilities;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;

namespace Microsoft.Azure.Commands.Consumption.Test.ScenarioTests.ScenarioTest
{
Expand Down Expand Up @@ -78,12 +77,11 @@ protected void SetupManagementClients(MockContext context)
ConsumptionManagementClient);
}

public void RunPowerShellTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts)
public void RunPowerShellTest(params string[] scripts)
{
var callingClassType = TestUtilities.GetCallingClass(2);
var mockName = TestUtilities.GetCurrentMethodName(2);

_helper.TracingInterceptor = logger;
RunPsTestWorkflow(
() => scripts,
// no custom initializer
Expand Down Expand Up @@ -179,7 +177,10 @@ private GalleryClient GetGalleryClient()

private ConsumptionManagementClient GetConsumptionManagementClient(MockContext context)
{
return context.GetServiceClient<ConsumptionManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
return
context.GetServiceClient<ConsumptionManagementClient>(
new Rest.ClientRuntime.Azure.TestFramework.TestEnvironment(
Environment.GetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION")));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,81 +16,60 @@
using Microsoft.Azure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit.Abstractions;
using Microsoft.Azure.ServiceManagemenet.Common.Models;

namespace Microsoft.Azure.Commands.Consumption.Test.ScenarioTests
{
public class UsageDetailsTests
public class UsageDetailsTests : RMTestBase
{
private ServiceManagemenet.Common.Models.XunitTracingInterceptor _logger;

public UsageDetailsTests(Xunit.Abstractions.ITestOutputHelper output)
public UsageDetailsTests(ITestOutputHelper output)
{
_logger = new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output);
ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
TestExecutionHelpers.SetUpSessionAndProfile();
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListUsageDetails()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListUsageDetails");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListUsageDetailsWithExpand()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListUsageDetailsWithExpand");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListUsageDetailsWithFilter()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListUsageDetailsWithFilter");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListInvoiceUsageDetails()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListInvoiceUsageDetails");
TestController.NewInstance.RunPowerShellTest("Test-ListUsageDetails");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListInvoiceUsageDetailsWithExpand()
public void TestListUsageDetailsWithMeterDetailsExpand()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListInvoiceUsageDetailsWithExpand");
TestController.NewInstance.RunPowerShellTest("Test-ListUsageDetailsWithMeterDetailsExpand");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListInvoiceUsageDetailsWithFilter()
public void TestListUsageDetailsWithDateFilter()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListInvoiceUsageDetailsWithFilter");
TestController.NewInstance.RunPowerShellTest("Test-ListUsageDetailsWithDateFilter");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListBillingPeriodUsageDetails()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListBillingPeriodUsageDetails");
TestController.NewInstance.RunPowerShellTest("Test-ListBillingPeriodUsageDetails");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListBillingPeriodUsageDetailsWithExpand()
public void TestListBillingPeriodUsageDetailsWithFilterOnInstanceName()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListBillingPeriodUsageDetailsWithExpand");
TestController.NewInstance.RunPowerShellTest("Test-ListBillingPeriodUsageDetailsWithFilterOnInstanceName");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestListBillingPeriodUsageDetailsWithFilter()
public void TestListBillingPeriodUsageDetailsWithDateFilter()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ListBillingPeriodUsageDetailsWithFilter");
TestController.NewInstance.RunPowerShellTest("Test-ListBillingPeriodUsageDetailsWithDateFilter");
}

}
Expand Down
Loading