-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1730 from microsoftgraph/dev
Merge dev into master
- Loading branch information
Showing
5 changed files
with
55 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,8 +253,8 @@ public void GeneratesSnippetsForCommandWithConflictingPathAndHeaderParameterName | |
} | ||
|
||
[Theory] | ||
[InlineData("?$select=name", " --select name")] | ||
[InlineData("?$filter=test&$select=name", " --filter test --select name")] | ||
[InlineData("?$select=name", " --select \"name\"")] | ||
[InlineData("?$filter=test&$select=name", " --filter \"test\" --select \"name\"")] | ||
public async Task GeneratesSnippetsForCommandWithODataParameters(string queryString, string commandOptions) | ||
{ | ||
// Given | ||
|
@@ -306,7 +306,7 @@ public void GeneratesSnippetsForCommandWithQueryParameters() | |
|
||
// Then | ||
// TODO: What should happen to the query parameter? | ||
Assert.Equal(notice + Environment.NewLine + "mgc tests get --id 10", result); | ||
Assert.Equal(notice + Environment.NewLine + "mgc tests get --id \"10\"", result); | ||
} | ||
|
||
[Theory] | ||
|
@@ -494,7 +494,7 @@ public async Task GeneratesSnippetsWithExpandQueryOptions() | |
var result = _generator.GenerateCodeSnippet(snippetModel); | ||
|
||
// Then | ||
Assert.Equal(notice + Environment.NewLine + "mgc users messages get --user-id {user-id} --message-id {message-id} --expand \"singleValueExtendedProperties(`$filter=id eq 'XXXX')\"", result); | ||
Assert.Equal(notice + Environment.NewLine + "mgc users messages get --user-id {user-id} --message-id {message-id} --expand \"singleValueExtendedProperties(\\$filter=id eq 'XXXX')\"", result); | ||
} | ||
[Fact] | ||
public async Task GeneratesSnippetsWithFilterQueryOptions() | ||
|
@@ -523,6 +523,6 @@ public async Task GeneratesSnippetsForHttpSnippetsWithUrlEncodedValuesForSystemQ | |
var result = _generator.GenerateCodeSnippet(snippetModel); | ||
|
||
// Then | ||
Assert.Equal(notice + Environment.NewLine + "mgc teams members list --team-id {team-id} --filter \"(microsoft.graph.aadUserConversationMember/displayName eq 'Harry Johnson' or microsoft.graph.aadUserConversationMember/email eq '[email protected]')\"", result); | ||
Assert.Equal(notice + Environment.NewLine + "mgc teams members list --team-id {team-id} --filter \"(microsoft.graph.aadUserConversationMember/displayName%20eq%20'Harry%20Johnson'%20or%20microsoft.graph.aadUserConversationMember/email%20eq%20'[email protected]')\"", result); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System.Net.Http; | ||
using System; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using CodeSnippetsReflection.OpenAPI.LanguageGenerators; | ||
|
@@ -144,8 +145,8 @@ public async Task GenerateForGroupPostTestSpacing() | |
}; | ||
var snippetModel = new SnippetModel(requestPayload, ServiceRootUrl, await GetV1SnippetMetadata()); | ||
var result = _generator.GenerateCodeSnippet(snippetModel); | ||
Assert.Contains("$requestBody = new Group();\n" + | ||
"$requestBody->setDescription('Self help community for library');\n" + | ||
Assert.Contains($"$requestBody = new Group();{Environment.NewLine}" + | ||
$"$requestBody->setDescription('Self help community for library');{Environment.NewLine}" + | ||
"$requestBody->setDisplayName('Library Assist');", result); | ||
} | ||
[Fact] | ||
|
@@ -874,7 +875,7 @@ public async Task GenerateWithComplexArray() | |
}; | ||
var snippetModel = new SnippetModel(requestPayload, ServiceRootUrl, await GetV1SnippetMetadata()); | ||
var result = _generator.GenerateCodeSnippet(snippetModel); | ||
Assert.Contains("'[email protected]' => [\n"+ | ||
Assert.Contains($"'[email protected]' => [{Environment.NewLine}"+ | ||
"'https://graph.microsoft.com/v1.0/users/26be1845-4119-4801-a799-aea79d09f1a2', ],", result); | ||
} | ||
} |
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