Skip to content

Commit cbb0cae

Browse files
committed
Removed ALL WARNINGS from both module and test solutions. NOTE: POSSIBLE BREAKING CHANGE FOR DATA ANALYTICS! There is 1 cmdlet that outputs multiple types, but boxed as a base type. I've updated the calls to the management SDK as to no longer use obsolete calls. However, the type from those calls is slightly changed to removed a few properties. But, that type isn't DIRECTLY returned. Again, boxed as the same base type that was returned prior. Made PowerBI dependent on Management.PowerBI as to remove an output conflict warning.
# Conflicts: # src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Models/PSDataLakeAnalyticsAccountBasic.cs # src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics/Models/PSJobInformationBasic.cs # src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Models/PSDataLakeStoreAccountBasic.cs # src/ResourceManager/Resources/Commands.Resources.Test/Models.ResourceGroups/GalleryTemplatesClientTests.cs
1 parent 792584c commit cbb0cae

File tree

54 files changed

+226
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+226
-271
lines changed

src/ResourceManager/Automation/Commands.Automation.Test/UnitTests/RegisterAzureAutomationScheduledRunbookTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public void RegisterAzureAutomationScheduledRunbookSuccessfull()
5050
string accountName = "automation";
5151
string runbookName = "runbook";
5252
string scheduleName = "schedule";
53-
string runOn = "hybridWorkerGroup";
5453

5554
this.mockAutomationClient.Setup(
5655
f => f.RegisterScheduledRunbook(resourceGroupName, accountName, runbookName, scheduleName, null, null));

src/ResourceManager/AzureBatch/Commands.Batch.Test/BatchAccounts/GetBatchNodeAgentSkusCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void ListBatchNodeAgentSkusParametersTest()
7878
int nodeAgentCount = 0;
7979
foreach (PSNodeAgentSku p in pipeline)
8080
{
81-
Assert.True(idsOfNodeAgentSkus.Contains(p.Id));
81+
Assert.Contains(p.Id, idsOfNodeAgentSkus);
8282
nodeAgentCount++;
8383
}
8484
Assert.Equal(idsOfNodeAgentSkus.Length, nodeAgentCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/BatchTestHelpers.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@ public static void AssertBatchAccountContextsAreEqual(BatchAccountContext contex
102102
return;
103103
}
104104

105-
Assert.Equal<string>(context1.AccountEndpoint, context2.AccountEndpoint);
106-
Assert.Equal<string>(context1.AccountName, context2.AccountName);
107-
Assert.Equal<string>(context1.Id, context2.Id);
108-
Assert.Equal<string>(context1.Location, context2.Location);
109-
Assert.Equal<string>(context1.PrimaryAccountKey, context2.PrimaryAccountKey);
110-
Assert.Equal<string>(context1.ResourceGroupName, context2.ResourceGroupName);
111-
Assert.Equal<string>(context1.SecondaryAccountKey, context2.SecondaryAccountKey);
112-
Assert.Equal<string>(context1.State, context2.State);
113-
Assert.Equal<string>(context1.Subscription, context2.Subscription);
114-
Assert.Equal<string>(context1.TagsTable, context2.TagsTable);
115-
Assert.Equal<string>(context1.TaskTenantUrl, context2.TaskTenantUrl);
116-
Assert.Equal<string>(context1.AutoStorageProperties.StorageAccountId, context2.AutoStorageProperties.StorageAccountId);
105+
Assert.Equal(context1.AccountEndpoint, context2.AccountEndpoint);
106+
Assert.Equal(context1.AccountName, context2.AccountName);
107+
Assert.Equal(context1.Id, context2.Id);
108+
Assert.Equal(context1.Location, context2.Location);
109+
Assert.Equal(context1.PrimaryAccountKey, context2.PrimaryAccountKey);
110+
Assert.Equal(context1.ResourceGroupName, context2.ResourceGroupName);
111+
Assert.Equal(context1.SecondaryAccountKey, context2.SecondaryAccountKey);
112+
Assert.Equal(context1.State, context2.State);
113+
Assert.Equal(context1.Subscription, context2.Subscription);
114+
Assert.Equal(context1.TagsTable, context2.TagsTable);
115+
Assert.Equal(context1.TaskTenantUrl, context2.TaskTenantUrl);
116+
Assert.Equal(context1.AutoStorageProperties.StorageAccountId, context2.AutoStorageProperties.StorageAccountId);
117117
}
118118

119119
/// <summary>

src/ResourceManager/AzureBatch/Commands.Batch.Test/Certificates/GetBatchCertificateCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void GetBatchCertificateTest()
7373
cmdlet.ExecuteCmdlet();
7474

7575
// Verify that the cmdlet wrote the cert returned from the OM to the pipeline
76-
Assert.Equal(1, pipeline.Count);
76+
Assert.Single(pipeline);
7777
Assert.Equal(cmdlet.Thumbprint, pipeline[0].Thumbprint);
7878
}
7979

@@ -178,7 +178,7 @@ public void ListBatchCertificatesWithoutFiltersTest()
178178
int poolCount = 0;
179179
foreach (PSCertificate c in pipeline)
180180
{
181-
Assert.True(thumbprintsOfConstructedCerts.Contains(c.Thumbprint));
181+
Assert.Contains(c.Thumbprint, thumbprintsOfConstructedCerts);
182182
poolCount++;
183183
}
184184
Assert.Equal(thumbprintsOfConstructedCerts.Length, poolCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodes/GetBatchComputeNodeCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void GetBatchComputeNodeTest()
7373
cmdlet.ExecuteCmdlet();
7474

7575
// Verify that the cmdlet wrote the compute node returned from the OM to the pipeline
76-
Assert.Equal(1, pipeline.Count);
76+
Assert.Single(pipeline);
7777
Assert.Equal(cmdlet.Id, pipeline[0].Id);
7878
}
7979

@@ -183,7 +183,7 @@ public void ListBatchComputeNodesWithoutFiltersTest()
183183
int computeNodeCount = 0;
184184
foreach (PSComputeNode c in pipeline)
185185
{
186-
Assert.True(idsOfConstructedComputeNodes.Contains(c.Id));
186+
Assert.Contains(c.Id, idsOfConstructedComputeNodes);
187187
computeNodeCount++;
188188
}
189189
Assert.Equal(idsOfConstructedComputeNodes.Length, computeNodeCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/Files/GetBatchNodeFileCommandTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void GetBatchNodeFileByTaskTest()
111111
cmdlet.ExecuteCmdlet();
112112

113113
// Verify that the cmdlet wrote the node file returned from the OM to the pipeline
114-
Assert.Equal(1, pipeline.Count);
114+
Assert.Single(pipeline);
115115
Assert.Equal(cmdlet.Path, pipeline[0].Path);
116116
}
117117

@@ -152,7 +152,7 @@ public void ListBatchNodeFilesByTaskByODataFilterTest()
152152
int taskCount = 0;
153153
foreach (PSNodeFile f in pipeline)
154154
{
155-
Assert.True(namesOfConstructedNodeFiles.Contains(f.Path));
155+
Assert.Contains(f.Path, namesOfConstructedNodeFiles);
156156
taskCount++;
157157
}
158158
Assert.Equal(namesOfConstructedNodeFiles.Length, taskCount);
@@ -196,7 +196,7 @@ public void ListBatchNodeFilesByTaskWithoutFiltersTest()
196196
int taskCount = 0;
197197
foreach (PSNodeFile f in pipeline)
198198
{
199-
Assert.True(namesOfConstructedNodeFiles.Contains(f.Path));
199+
Assert.Contains(f.Path, namesOfConstructedNodeFiles);
200200
taskCount++;
201201
}
202202
Assert.Equal(namesOfConstructedNodeFiles.Length, taskCount);
@@ -309,7 +309,7 @@ public void GetBatchNodeFileByComputeNodeTest()
309309
cmdlet.ExecuteCmdlet();
310310

311311
// Verify that the cmdlet wrote the node file returned from the OM to the pipeline
312-
Assert.Equal(1, pipeline.Count);
312+
Assert.Single(pipeline);
313313
Assert.Equal(cmdlet.Path, pipeline[0].Path);
314314
}
315315

@@ -351,7 +351,7 @@ public void ListBatchNodeFilesByComputeNodeByODataFilterTest()
351351
int taskCount = 0;
352352
foreach (PSNodeFile f in pipeline)
353353
{
354-
Assert.True(namesOfConstructedNodeFiles.Contains(f.Path));
354+
Assert.Contains(f.Path, namesOfConstructedNodeFiles);
355355
taskCount++;
356356
}
357357
Assert.Equal(namesOfConstructedNodeFiles.Length, taskCount);
@@ -395,7 +395,7 @@ public void ListBatchNodeFilesByComputeNodeWithoutFiltersTest()
395395
int taskCount = 0;
396396
foreach (PSNodeFile f in pipeline)
397397
{
398-
Assert.True(namesOfConstructedNodeFiles.Contains(f.Path));
398+
Assert.Contains(f.Path, namesOfConstructedNodeFiles);
399399
taskCount++;
400400
}
401401
Assert.Equal(namesOfConstructedNodeFiles.Length, taskCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/JobSchedules/GetBatchJobScheduleCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void GetBatchJobScheduleTest()
7272
cmdlet.ExecuteCmdlet();
7373

7474
// Verify that the cmdlet wrote the job schedule returned from the OM to the pipeline
75-
Assert.Equal(1, pipeline.Count);
75+
Assert.Single(pipeline);
7676
Assert.Equal(cmdlet.Id, pipeline[0].Id);
7777
}
7878

@@ -177,7 +177,7 @@ public void ListBatchJobSchedulesWithoutFiltersTest()
177177
int jobScheduleCount = 0;
178178
foreach (PSCloudJobSchedule j in pipeline)
179179
{
180-
Assert.True(idsOfConstructedJobSchedules.Contains(j.Id));
180+
Assert.Contains(j.Id, idsOfConstructedJobSchedules);
181181
jobScheduleCount++;
182182
}
183183
Assert.Equal(idsOfConstructedJobSchedules.Length, jobScheduleCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/Jobs/GetBatchJobCommandTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void GetBatchJobTest()
8181
cmdlet.ExecuteCmdlet();
8282

8383
// Verify that the cmdlet wrote the job returned from the OM to the pipeline
84-
Assert.Equal(1, pipeline.Count);
84+
Assert.Single(pipeline);
8585
Assert.Equal(cmdlet.Id, pipeline[0].Id);
8686
Assert.Equal(OnTaskFailure.PerformExitOptionsJobAction, pipeline[0].OnTaskFailure);
8787
Assert.Equal(OnAllTasksComplete.TerminateJob, pipeline[0].OnAllTasksComplete);
@@ -193,7 +193,7 @@ public void ListBatchJobsWithoutFiltersTest()
193193
int jobCount = 0;
194194
foreach (PSCloudJob j in pipeline)
195195
{
196-
Assert.True(idsOfConstructedJobs.Contains(j.Id));
196+
Assert.Contains(j.Id, idsOfConstructedJobs);
197197
jobCount++;
198198
}
199199
Assert.Equal(idsOfConstructedJobs.Length, jobCount);
@@ -272,7 +272,7 @@ public void ListBatchJobsUnderScheduleTest()
272272
int jobCount = 0;
273273
foreach (PSCloudJob j in pipeline)
274274
{
275-
Assert.True(idsOfConstructedJobs.Contains(j.Id));
275+
Assert.Contains(j.Id, idsOfConstructedJobs);
276276
jobCount++;
277277
}
278278
Assert.Equal(idsOfConstructedJobs.Length, jobCount);
@@ -318,7 +318,7 @@ public void WhenGettingAJobFromTheService_ApplicationPackageReferencesAreMapped(
318318
cmdlet.ExecuteCmdlet();
319319

320320
// Verify that the cmdlet wrote the task returned from the OM to the pipeline
321-
Assert.Equal(1, pipeline.Count);
321+
Assert.Single(pipeline);
322322
Assert.Equal(cmdlet.Id, pipeline[0].Id);
323323

324324
var psApplicationPackageReference = pipeline[0].JobManagerTask.ApplicationPackageReferences.First();

src/ResourceManager/AzureBatch/Commands.Batch.Test/Jobs/GetBatchJobPreparationAndReleaseTaskStatusTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void GetBatchJobPreparationAndReleaseTaskStatusTest()
8787
cmdlet.ExecuteCmdlet();
8888

8989
// Verify that the cmdlet wrote the constructed jobs to the pipeline
90-
Assert.Equal(1, pipeline.Count);
90+
Assert.Single(pipeline);
9191
foreach (PSJobPreparationAndReleaseTaskExecutionInformation j in pipeline)
9292
{
9393
Assert.Equal(poolId, j.PoolId);

src/ResourceManager/AzureBatch/Commands.Batch.Test/Jobs/NewBatchJobCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public void NewBatchJobParametersTest()
6565
new AzureOperationHeaderResponse<JobAddHeaders>(),
6666
request =>
6767
{
68-
Assert.Equal(request.Parameters.OnAllTasksComplete, OnAllTasksComplete.TerminateJob);
69-
Assert.Equal(request.Parameters.OnTaskFailure, OnTaskFailure.PerformExitOptionsJobAction);
68+
Assert.Equal(OnAllTasksComplete.TerminateJob, request.Parameters.OnAllTasksComplete);
69+
Assert.Equal(OnTaskFailure.PerformExitOptionsJobAction, request.Parameters.OnTaskFailure);
7070
});
7171

7272
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };

src/ResourceManager/AzureBatch/Commands.Batch.Test/Jobs/SetBatchJobCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void AutoCompletionSettingIsSentToService()
117117
new AzureOperationHeaderResponse<JobUpdateHeaders>(),
118118
request =>
119119
{
120-
Assert.Equal((OnAllTasksComplete)request.Parameters.OnAllTasksComplete, OnAllTasksComplete.TerminateJob);
120+
Assert.Equal(OnAllTasksComplete.TerminateJob, (OnAllTasksComplete)request.Parameters.OnAllTasksComplete);
121121
});
122122

123123
cmdlet.AdditionalBehaviors = new BatchClientBehavior[] { interceptor };

src/ResourceManager/AzureBatch/Commands.Batch.Test/Pools/GetBatchPoolCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void GetBatchPoolTest()
7272
cmdlet.ExecuteCmdlet();
7373

7474
// Verify that the cmdlet wrote the pool returned from the OM to the pipeline
75-
Assert.Equal(1, pipeline.Count);
75+
Assert.Single(pipeline);
7676
Assert.Equal(cmdlet.Id, pipeline[0].Id);
7777
}
7878

@@ -181,7 +181,7 @@ public void ListBatchPoolWithoutFiltersTest()
181181
int poolCount = 0;
182182
foreach (PSCloudPool p in pipeline)
183183
{
184-
Assert.True(idsOfConstructedPools.Contains(p.Id));
184+
Assert.Contains(p.Id, idsOfConstructedPools);
185185
poolCount++;
186186
}
187187
Assert.Equal(idsOfConstructedPools.Length, poolCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/Pools/GetBatchPoolUsageMetricsCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void GetBatchPoolUsageODataTest()
8686
int poolUsageCount = 0;
8787
foreach (PSPoolUsageMetrics p in pipeline)
8888
{
89-
Assert.True(poolIds.Contains(p.PoolId));
89+
Assert.Contains(p.PoolId, poolIds);
9090
poolUsageCount++;
9191
}
9292

src/ResourceManager/AzureBatch/Commands.Batch.Test/Pools/NewBatchPoolCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ public void NewBatchPoolAutoScaleHandledProperlyTest()
172172
// Verify the request parameters match the cmdlet parameters
173173
Assert.Equal(cmdlet.AutoScaleEvaluationInterval, requestParameters.AutoScaleEvaluationInterval);
174174
Assert.Equal(cmdlet.AutoScaleFormula, requestParameters.AutoScaleFormula);
175-
Assert.Equal(true, requestParameters.EnableAutoScale);
176-
Assert.Equal(null, requestParameters.TargetDedicatedNodes);
175+
Assert.True(requestParameters.EnableAutoScale);
176+
Assert.Null(requestParameters.TargetDedicatedNodes);
177177
}
178178

179179
[Fact]

src/ResourceManager/AzureBatch/Commands.Batch.Test/Tasks/GetBatchSubtaskCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void ListBatchSubtasksWithoutFiltersTest()
109109
int SubtaskCount = 0;
110110
foreach (PSSubtaskInformation s in pipeline)
111111
{
112-
Assert.True(idsOfConstructedSubtasks.Contains(s.Id.Value));
112+
Assert.Contains(s.Id.Value, idsOfConstructedSubtasks);
113113
SubtaskCount++;
114114
}
115115
Assert.Equal(idsOfConstructedSubtasks.Length, SubtaskCount);

src/ResourceManager/AzureBatch/Commands.Batch.Test/Tasks/GetBatchTaskCommandTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void GetBatchTaskTest()
103103
cmdlet.ExecuteCmdlet();
104104

105105
// Verify that the cmdlet wrote the task returned from the OM to the pipeline
106-
Assert.Equal(1, pipeline.Count);
106+
Assert.Single(pipeline);
107107
Assert.Equal(cmdlet.Id, pipeline[0].Id);
108108
}
109109

@@ -216,7 +216,7 @@ public void ListBatchTasksWithoutFiltersTest()
216216
int taskCount = 0;
217217
foreach (PSCloudTask t in pipeline)
218218
{
219-
Assert.True(idsOfConstructedTasks.Contains(t.Id));
219+
Assert.Contains(t.Id, idsOfConstructedTasks);
220220
taskCount++;
221221
}
222222
Assert.Equal(idsOfConstructedTasks.Length, taskCount);
@@ -308,15 +308,15 @@ public void WhenGettingATaskFromTheService_ExitConditionsAreMapped()
308308
cmdlet.ExecuteCmdlet();
309309

310310
// Verify that the cmdlet wrote the task returned from the OM to the pipeline
311-
Assert.Equal(1, pipeline.Count);
311+
Assert.Single(pipeline);
312312
Assert.Equal(cmdlet.Id, pipeline[0].Id);
313313

314314
PSExitConditions psExitConditions = pipeline[0].ExitConditions;
315315

316-
Assert.Equal(psExitConditions.Default.JobAction, JobAction.None);
317-
Assert.Equal(psExitConditions.ExitCodeRanges.First().ExitOptions.JobAction, JobAction.None);
318-
Assert.Equal(psExitConditions.PreProcessingError.JobAction, JobAction.Terminate);
319-
Assert.Equal(psExitConditions.FileUploadError.JobAction, JobAction.None);
316+
Assert.Equal(JobAction.None, psExitConditions.Default.JobAction);
317+
Assert.Equal(JobAction.None, psExitConditions.ExitCodeRanges.First().ExitOptions.JobAction);
318+
Assert.Equal(JobAction.Terminate, psExitConditions.PreProcessingError.JobAction);
319+
Assert.Equal(JobAction.None, psExitConditions.FileUploadError.JobAction);
320320

321321
Assert.Equal(4, psExitConditions.ExitCodes.First().Code);
322322
Assert.Equal(JobAction.Terminate, psExitConditions.ExitCodes.First().ExitOptions.JobAction);
@@ -359,7 +359,7 @@ public void WhenGettingATaskFromTheService_ApplicationPackageReferencesAreMapped
359359
cmdlet.ExecuteCmdlet();
360360

361361
// Verify that the cmdlet wrote the task returned from the OM to the pipeline
362-
Assert.Equal(1, pipeline.Count);
362+
Assert.Single(pipeline);
363363
Assert.Equal(cmdlet.Id, pipeline[0].Id);
364364

365365
var psApplicationPackageReference = pipeline[0].ApplicationPackageReferences.First();

src/ResourceManager/AzureBatch/Commands.Batch.Test/Tasks/NewBatchTaskCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void ApplicationPackageReferencesAreSentOnATask()
173173
cmdlet.ExecuteCmdlet();
174174
}
175175

176-
public void ExitConditionsAreSentToService()
176+
private void ExitConditionsAreSentToService()
177177
{
178178
BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();
179179
cmdlet.BatchContext = context;
@@ -343,7 +343,7 @@ public void NewBatchTaskCollectionParametersTest()
343343
Assert.Equal(2, requestCollection.Count);
344344
foreach (var task in requestCollection)
345345
{
346-
Assert.True(taskIds.Contains(task.Id));
346+
Assert.Contains(task.Id, taskIds);
347347
}
348348
}
349349

src/ResourceManager/Compute/Commands.Compute/Extension/NetcoreExtension.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,6 @@ public NetworkClient()
139139
}
140140
}
141141

142-
namespace Microsoft.Azure.Management.Internal.Network.Common
143-
{
144-
public interface IResourceReference
145-
{
146-
string Id { get; set; }
147-
}
148-
}
149-
namespace Microsoft.Azure.Management.Internal.Network.Common
150-
{
151-
public interface INetworkInterfaceReference : IResourceReference
152-
{
153-
bool? Primary { get; set; }
154-
}
155-
}
156-
157142
namespace Microsoft.Azure.Commands.Network.Models
158143
{
159144
public class PSResourceId

0 commit comments

Comments
 (0)