From eb67efecd22cd5cd9665f465d1b96896cf888590 Mon Sep 17 00:00:00 2001 From: Peter Wasonga Ombwa Date: Tue, 15 Jan 2019 13:16:38 -0800 Subject: [PATCH 1/2] Updated release notes --- src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj | 6 ++++-- src/Microsoft.Graph/Microsoft.Graph.csproj | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj index 26aa767ae49..e208968d01f 100644 --- a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj +++ b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj @@ -13,10 +13,12 @@ Microsoft.Graph.Core Microsoft Office365;Graph;GraphServiceClient;Outlook;OneDrive;AzureAD;GraphAPI;Productivity;SharePoint;Intune;SDK -January 2019 Release Summary (version 1.13.0-preview.2) +January 2019 Release Summary (version 1.13.0) - Authentication handler added. - Removed Newtonsoft.Json package reference upper bound limitation. +- Makes GraphClientFactory internal. +- HttpProvider uses GraphClientFactory. https://developer.microsoft.com/graph http://aka.ms/devservicesagreement @@ -36,7 +38,7 @@ January 2019 Release Summary (version 1.13.0-preview.2) false 35MSSharedLib1024.snk true - 1.13.0-preview.2 + 1.13.0 bin\Release\netstandard1.1\Microsoft.Graph.Core.xml diff --git a/src/Microsoft.Graph/Microsoft.Graph.csproj b/src/Microsoft.Graph/Microsoft.Graph.csproj index 053c31417f1..ffe2a25b0f1 100644 --- a/src/Microsoft.Graph/Microsoft.Graph.csproj +++ b/src/Microsoft.Graph/Microsoft.Graph.csproj @@ -13,7 +13,7 @@ Microsoft.Graph Microsoft Office365;Graph;GraphServiceClient;Outlook;OneDrive;AzureAD;GraphAPI;Productivity;SharePoint;Intune;SDK -January 2019 Release Summary (version 1.13.0-preview.2) +January 2019 Release Summary (version 1.13.0) New functionality - Added new Teams API functionality. @@ -45,7 +45,7 @@ Updated functionality false 35MSSharedLib1024.snk true - 1.13.0-preview.2 + 1.13.0 bin\Release\Microsoft.Graph.xml From 470ef4475edf7981bbbdfd93a8438b8ac42ea79a Mon Sep 17 00:00:00 2001 From: Peter Wasonga Ombwa Date: Tue, 15 Jan 2019 14:53:31 -0800 Subject: [PATCH 2/2] Fix broken GraphClientFactory test --- .../Mocks/MockRedirctHandler.cs | 4 ++-- .../Requests/GraphClientFactoryTests.cs | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Test/Mocks/MockRedirctHandler.cs b/tests/Microsoft.Graph.DotnetCore.Core.Test/Mocks/MockRedirctHandler.cs index a9e1b820f57..695b65c229b 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Test/Mocks/MockRedirctHandler.cs +++ b/tests/Microsoft.Graph.DotnetCore.Core.Test/Mocks/MockRedirctHandler.cs @@ -23,13 +23,13 @@ protected async override Task SendAsync(HttpRequestMessage { _response1Sent = true; _response1.RequestMessage = request; - return _response1; + return await Task.FromResult(_response1); } else { _response1Sent = false; _response2.RequestMessage = request; - return _response2; + return await Task.FromResult(_response2); } } diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/GraphClientFactoryTests.cs b/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/GraphClientFactoryTests.cs index 368aa35f867..62535976992 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/GraphClientFactoryTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/GraphClientFactoryTests.cs @@ -25,7 +25,7 @@ public class GraphClientFactoryTests : IDisposable public GraphClientFactoryTests() { this.testHttpMessageHandler = new MockRedirectHandler(); - handlers = handlers = new DelegatingHandler[3]; + handlers = new DelegatingHandler[3]; handlers[0] = new RetryHandler(); handlers[1] = new RedirectHandler(); handlers[2] = new AuthenticationHandler(authenticationProvider.Object); @@ -37,16 +37,19 @@ public void Dispose() this.testHttpMessageHandler.Dispose(); } + // Note: + // 1. Xunit's IsType doesn't consider inheritance behind the classes. + // 2. We can't control the order of execution for the tests + // and 'GraphClientFactory.DefaultHttpHandler' can easily be modified + // by other tests since it's a static delegate. [Fact] public void CreatePipelineWithoutHttpMessageHandlerInput() { using (RetryHandler retryHandler = (RetryHandler)GraphClientFactory.CreatePipeline(handlers)) using (RedirectHandler redirectHandler = (RedirectHandler)retryHandler.InnerHandler) using (AuthenticationHandler authenticationHandler = (AuthenticationHandler)redirectHandler.InnerHandler) - using (HttpClientHandler innerMost = (HttpClientHandler)authenticationHandler.InnerHandler) + using (HttpMessageHandler innerMost = authenticationHandler.InnerHandler) { - System.Diagnostics.Debug.WriteLine("InvalidCast: " + authenticationHandler.InnerHandler.GetType().ToString()); - Assert.NotNull(retryHandler); Assert.NotNull(redirectHandler); Assert.NotNull(authenticationHandler); @@ -54,7 +57,7 @@ public void CreatePipelineWithoutHttpMessageHandlerInput() Assert.IsType(typeof(RetryHandler), retryHandler); Assert.IsType(typeof(RedirectHandler), redirectHandler); Assert.IsType(typeof(AuthenticationHandler), authenticationHandler); - Assert.IsType(typeof(HttpClientHandler), innerMost); + Assert.True(innerMost is HttpMessageHandler); } }