diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj b/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj index 4a26e981333..bf45cb1831b 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/BatchRequestTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/BatchRequestTests.cs index d21c87d452f..c6ac55ba990 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/BatchRequestTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/BatchRequestTests.cs @@ -33,9 +33,11 @@ public async Task JsonBatchRequest() BatchRequestStep requestStep2 = new BatchRequestStep("2", httpRequestMessage2, new List { "1" }); var baseClient = new GraphServiceClient(new HttpClientRequestAdapter(new AnonymousAuthenticationProvider())); +#pragma warning disable CS0618 // Type or member is obsolete BatchRequestContent batchRequestContent = new BatchRequestContent(baseClient); batchRequestContent.AddBatchRequestStep(requestStep1); batchRequestContent.AddBatchRequestStep(requestStep2); +#pragma warning restore CS0618 // Type or member is obsolete HttpResponseMessage response = await httpClient.PostAsync("https://graph.microsoft.com/v1.0/$batch", batchRequestContent); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/PlannerTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/PlannerTests.cs index abc46a6eaa9..818f29db0d6 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/PlannerTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/PlannerTests.cs @@ -198,7 +198,7 @@ public async Task PlannerTaskDetailsUpdate() Assert.Equal(2, updatedTaskDetails.Checklist.AdditionalData.Count()); Assert.Equal("Do something", ((PlannerCheckListItem)updatedTaskDetails.Checklist.AdditionalData[checklistItemId1])?.Title); Assert.Equal("Do something else", ((PlannerCheckListItem)updatedTaskDetails.Checklist.AdditionalData[checklistItemId2])?.Title); - Assert.Equal(1, updatedTaskDetails.References.AdditionalData.Count()); + Assert.Single(updatedTaskDetails.References.AdditionalData); Assert.Equal("Developer resources", ((PlannerExternalReference)updatedTaskDetails.References.AdditionalData["http://developer.microsoft.com"])?.Alias); } diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/SharePointTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/SharePointTests.cs index 20a6cdf63f0..dfef1ae71e1 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/SharePointTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/SharePointTests.cs @@ -63,10 +63,9 @@ public async Task It_gets_the_sites_drives_root_children() Assert.True(siteSearchResults.Value.Count > 0, "Expected at least one search result. Got zero. Check test data."); // Call the Microsoft Graph API. Get the sites drives collection page. - var drives = graphClient.Sites[siteSearchResults.Value[0].Id] + var drives = await graphClient.Sites[siteSearchResults.Value[0].Id] .Drives - .GetAsync() - .Result; + .GetAsync(); // Call the Microsoft Graph API. Get the drives collection page. // var library = graphClient.Sites[siteSearchResults.Value[0].Id]