Skip to content

Commit 507dd02

Browse files
committed
update test records
1 parent b6f5de3 commit 507dd02

File tree

9 files changed

+1620
-197
lines changed

9 files changed

+1620
-197
lines changed

src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
<Compile Include="Generated\TagOperationsExtensions.cs" />
269269
<Compile Include="Generated\TenantOperations.cs" />
270270
<Compile Include="Generated\TenantOperationsExtensions.cs" />
271+
<Compile Include="GlobalSuppressions.cs" />
271272
<Compile Include="Properties\AssemblyInfo.cs" />
272273
<Compile Include="Properties\Resources.Designer.cs">
273274
<AutoGen>True</AutoGen>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
//
6+
// To add a suppression to this file, right-click the message in the
7+
// Code Analysis results, point to "Suppress Message", and click
8+
// "In Suppression File".
9+
// You do not need to add suppressions to this file manually.
10+
11+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Scope = "type", Target = "Microsoft.Azure.Management.Internal.Resources.AuthorizationClient")]
12+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Scope = "type", Target = "Microsoft.Azure.Management.Internal.Resources.FeatureClient")]
13+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Scope = "type", Target = "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient")]
14+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Scope = "type", Target = "Microsoft.Azure.Internal.Subscriptions.SubscriptionClient")]

src/ResourceManager/Profile/Commands.Profile.Test/AzureRMProfileTests.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ private static RMProfileClient SetupTestEnvironment(List<string> tenants, params
6565
public void MultipleTenantsAndSubscriptionsSucceed()
6666
{
6767
var tenants = new List<string> {Guid.NewGuid().ToString(), DefaultTenant.ToString()};
68-
var firstList = new List<string> { DefaultSubscription.ToString(), Guid.NewGuid().ToString() };
68+
var secondsubscriptionInTheFirstTenant = Guid.NewGuid().ToString();
69+
var firstList = new List<string> { DefaultSubscription.ToString(), secondsubscriptionInTheFirstTenant};
6970
var secondList = new List<string> { Guid.NewGuid().ToString()};
70-
var client = SetupTestEnvironment(tenants, firstList, secondList);
71+
var thirdList = new List<string> { DefaultSubscription.ToString(), secondsubscriptionInTheFirstTenant };
72+
var client = SetupTestEnvironment(tenants, firstList, secondList, thirdList);
7173
var subResults = new List<AzureSubscription>(client.ListSubscriptions());
7274
Assert.Equal(3, subResults.Count);
7375
var tenantResults = client.ListTenants();
@@ -84,8 +86,9 @@ public void MultipleTenantsAndSubscriptionsSucceed()
8486
public void SingleTenantAndSubscriptionSucceeds()
8587
{
8688
var tenants = new List<string> {DefaultTenant.ToString()};
87-
var subscriptions = new List<string> {DefaultSubscription.ToString()};
88-
var client = SetupTestEnvironment(tenants, subscriptions);
89+
var firstList = new List<string> {DefaultSubscription.ToString()};
90+
var secondList = firstList;
91+
var client = SetupTestEnvironment(tenants, firstList, secondList);
8992
var subResults = new List<AzureSubscription>(client.ListSubscriptions());
9093
Assert.Equal(1, subResults.Count);
9194
var tenantResults = client.ListTenants();
@@ -102,12 +105,14 @@ public void SingleTenantAndSubscriptionSucceeds()
102105
public void SubscriptionNotFoundDoesNotThrow()
103106
{
104107
var tenants = new List<string> { DefaultTenant.ToString() };
105-
var subscriptions = new List<string> { Guid.NewGuid().ToString() };
106-
var client = SetupTestEnvironment(tenants, subscriptions);
108+
string randomSubscriptionId = Guid.NewGuid().ToString();
109+
var firstList = new List<string> { randomSubscriptionId };
110+
var secondList = firstList;
111+
var client = SetupTestEnvironment(tenants, firstList, secondList);
107112
var subResults = new List<AzureSubscription>(client.ListSubscriptions());
108113
Assert.Equal(1, subResults.Count);
109114
AzureSubscription subValue;
110-
Assert.True(client.TryGetSubscriptionById(DefaultTenant.ToString(), DefaultSubscription.ToString(), out subValue));
115+
Assert.False(client.TryGetSubscriptionById(DefaultTenant.ToString(), DefaultSubscription.ToString(), out subValue));
111116
}
112117

113118
[Fact]
@@ -130,7 +135,7 @@ public void NoSubscriptionsInListDoesNotThrow()
130135
var client = SetupTestEnvironment(tenants, subscriptions);
131136
Assert.Equal(0, client.ListSubscriptions().Count());
132137
AzureSubscription subValue;
133-
Assert.True(client.TryGetSubscriptionById(DefaultTenant.ToString(), DefaultSubscription.ToString(), out subValue));
138+
Assert.False(client.TryGetSubscriptionById(DefaultTenant.ToString(), DefaultSubscription.ToString(), out subValue));
134139
}
135140

136141
[Fact]

0 commit comments

Comments
 (0)