-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed a regression where passing custom base url would not be refle…
…cted in the requests.
- Loading branch information
1 parent
b5415b9
commit e5e2c88
Showing
4 changed files
with
58 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/Microsoft.Graph.DotnetCore.Test/Models/GraphServiceClientTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// ------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
// ------------------------------------------------------------------------------ | ||
|
||
using Microsoft.Graph.Beta; | ||
using Microsoft.Kiota.Abstractions.Authentication; | ||
using Xunit; | ||
|
||
namespace Microsoft.Graph.DotnetCore.Test.Models; | ||
|
||
public class GraphServiceClientTests | ||
{ | ||
[Fact] | ||
public void InitializesClient() | ||
{ | ||
// Arrange | ||
var graphClient = new GraphServiceClient(new AnonymousAuthenticationProvider()); | ||
|
||
// Act | ||
var userRequestInformation = graphClient.Me.ToGetRequestInformation(); | ||
|
||
// Assert | ||
Assert.Contains("https://graph.microsoft.com", userRequestInformation.URI.OriginalString); | ||
} | ||
|
||
[Fact] | ||
public void InitializesClientWithCustomBaseUrl() | ||
{ | ||
// Arrange | ||
var customBaseUrl = "https://graph.microsoft-ppe.com"; | ||
var graphClient = new GraphServiceClient(new AnonymousAuthenticationProvider(), customBaseUrl); | ||
|
||
// Act | ||
var userRequestInformation = graphClient.Me.ToGetRequestInformation(); | ||
|
||
// Assert | ||
Assert.Contains(customBaseUrl, userRequestInformation.URI.OriginalString); | ||
} | ||
} |