-
Notifications
You must be signed in to change notification settings - Fork 201
Allow caller to Specify desired OutputType #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bbaabce
Add "-Raw" to return full HttpResponseMessage object.
ba66835
Introduce -OutputType parameter to allow user to specifiy outputtype …
c940a87
Remove unused methods.
ceb2c91
Add async suffix.
5fd54c3
Merge branch 'dev' into features/IGRImprovements
georgend 353290a
rename for better error reporting.
1041f15
Merge branch 'features/IGRImprovements' of https://github.com/microso…
889483f
Fix up broken tests due to missing sdk reference.
72c2924
Reorder package sources.
ea8e6e9
Use a certificate to authenticate against demo tenant for integration…
1f53245
Changes Error.
9218589
CertificateName
3629d5c
string formatting
99facb6
Rename certificate step.
1684b53
Import Cert locally.
ba2b2bd
Inform user of Non-Json Responses and possible resolutions.
b2b2b90
Merge branch 'dev' into features/IGRImprovements
georgend 49072ed
Change reference versions.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -353,4 +353,7 @@ MigrationBackup/ | |
.ionide/ | ||
|
||
# Visual Studio Code | ||
.vscode/ | ||
.vscode/ | ||
|
||
#Custom Environment Files | ||
localenv.json |
This file contains hidden or 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
56 changes: 37 additions & 19 deletions
56
src/Authentication/Authentication.Test/Helpers/StringUtilTests.cs
This file contains hidden or 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 |
---|---|---|
@@ -1,37 +1,55 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
namespace Microsoft.Graph.Authentication.Test.Helpers | ||
{ | ||
|
||
using Microsoft.Graph.PowerShell.Authentication.Helpers; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Management.Automation; | ||
|
||
using Xunit; | ||
using Microsoft.Graph.PowerShell.Authentication.Helpers; | ||
|
||
using Xunit; | ||
|
||
namespace Microsoft.Graph.Authentication.Test.Helpers | ||
{ | ||
public class StringUtilTests | ||
{ | ||
private const string TestJsonArray = "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users\"," + "\"value\": [{\"id\": \"6e7b768e-07e2-4810-8459-485f84f8f204\"},{\"id\": \"87d349ed-44d7-43e1-9a83-5f2406dee5bd\"}]}"; | ||
|
||
private const string TestJsonObject = "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users/$entity\",\"businessPhones\": [\"+1 412 555 0109\"],\"displayName\": \"Megan Bowen\",\"givenName\": \"Megan\",\"jobTitle\": \"Auditor\",\"mail\": \"[email protected]\", \"mobilePhone\": null, \"officeLocation\": \"12/1110\",\"preferredLanguage\": \"en-US\",\"surname\": \"Bowen\",\"userPrincipalName\": \"[email protected]\",\"id\": \"48d31887-5fad-4d73-a9f5-3c356e68a038\"}"; | ||
public static IEnumerable<object[]> TestJsonData => | ||
new List<object[]> | ||
{ | ||
new object[] { TestJsonArray}, | ||
new object[] { TestJsonObject} | ||
}; | ||
|
||
[Theory] | ||
[MemberData(nameof(TestJsonData))] | ||
public void ShouldReturnCaseInsensitiveDictionaries(string jsonString) | ||
{ | ||
Exception ex = null; | ||
var converted = jsonString.TryConvertToJson(out var jsonObj, ref ex); | ||
var hashTable = jsonString.ConvertFromJson(true, null, out _); | ||
|
||
Assert.True(converted); | ||
Assert.IsType<Hashtable>(jsonObj); | ||
var jsonHashTable = (Hashtable)jsonObj; | ||
Assert.NotNull(hashTable); | ||
var jsonHashTable = (Hashtable)hashTable; | ||
Assert.Equal(jsonHashTable["Value"], jsonHashTable["value"]); | ||
} | ||
public static IEnumerable<object[]> TestJsonData => | ||
new List<object[]> | ||
{ | ||
new object[] { TestJsonArray}, | ||
new object[] { TestJsonObject} | ||
}; | ||
|
||
[Theory] | ||
[MemberData(nameof(TestJsonData))] | ||
public void ShouldReturnPsObject(string jsonString) | ||
{ | ||
var psObject = jsonString.ConvertFromJson(false, null, out _); | ||
|
||
Assert.NotNull(psObject); | ||
Assert.IsType<PSObject>(psObject); | ||
} | ||
|
||
[Theory] | ||
[MemberData(nameof(TestJsonData))] | ||
public void ShouldReturnHashTable(string jsonString) | ||
{ | ||
var hashTable = jsonString.ConvertFromJson(true, null, out _); | ||
|
||
Assert.NotNull(hashTable); | ||
Assert.IsType<Hashtable>(hashTable); | ||
} | ||
} | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.