From 3fe8dd804a7d42a2e4f279365c0ab2053757a57e Mon Sep 17 00:00:00 2001 From: nebadr <48523292+nebadr@users.noreply.github.com> Date: Mon, 1 Apr 2019 20:08:40 +0200 Subject: [PATCH] Fix Authoring SDK Tests (#5641) --- .../LUIS/Authoring.Tests/Luis/AppsTests.cs | 2 +- .../Authoring.Tests/Luis/EntityRolesTests.cs | 48 +++++++++---------- .../Luis/ModelEntitiesTests.cs | 2 +- .../Luis/ModelPatternAnyTests.cs | 4 +- .../Luis/ModelRegexEntitiesTests.cs | 4 +- .../Authoring.Tests/Luis/PatternsTests.cs | 8 ++-- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/AppsTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/AppsTests.cs index 858ba811dd154..bc251b09a8092 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/AppsTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/AppsTests.cs @@ -257,7 +257,7 @@ public void UpdateSettings() await client.Apps.UpdateSettingsAsync(testAppId, new ApplicationSettingUpdateObject { - PublicProperty = true + IsPublic = true }); // Assert diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/EntityRolesTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/EntityRolesTests.cs index 36cbabfd6dfe1..d260318c83bec 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/EntityRolesTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/EntityRolesTests.cs @@ -24,7 +24,7 @@ public void AddSimpleEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteEntityAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -41,7 +41,7 @@ public void AddPrebuiltEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeletePrebuiltAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -65,7 +65,7 @@ public void AddClosedListEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetClosedListEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListClosedListEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteClosedListAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -86,7 +86,7 @@ public void AddRegexEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetRegexEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListRegexEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteRegexEntityModelAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -113,7 +113,7 @@ public void AddCompositeEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetCompositeEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListCompositeEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteCompositeEntityAsync(GlobalAppId, "0.1", entityId); foreach (var added in prebuiltEntitiesAdded) { @@ -138,7 +138,7 @@ public void AddPatternAnyEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetPatternAnyEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListPatternAnyEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeletePatternAnyEntityModelAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -160,7 +160,7 @@ public void AddHierarchicalEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetHierarchicalEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListHierarchicalEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteHierarchicalEntityAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -182,7 +182,7 @@ public void AddCustomPrebuiltDomainEntityRole() { Name = "simple role" }); - var roles = await client.Model.GetCustomPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListCustomPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteEntityAsync(GlobalAppId, "0.1", entityId); Assert.Contains(roles, r => r.Name == "simple role"); @@ -380,7 +380,7 @@ public void GetSimpleEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteEntityAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -397,7 +397,7 @@ public void GetPrebuiltEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeletePrebuiltAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -421,7 +421,7 @@ public void GetClosedListEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetClosedListEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListClosedListEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteClosedListAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -442,7 +442,7 @@ public void GetRegexEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetRegexEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListRegexEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteRegexEntityModelAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -469,7 +469,7 @@ public void GetCompositeEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetCompositeEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListCompositeEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteCompositeEntityAsync(GlobalAppId, "0.1", entityId); foreach (var added in prebuiltEntitiesAdded) { @@ -494,7 +494,7 @@ public void GetPatternAnyEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetPatternAnyEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListPatternAnyEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeletePatternAnyEntityModelAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -516,7 +516,7 @@ public void GetHierarchicalEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetHierarchicalEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListHierarchicalEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteHierarchicalEntityAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -538,7 +538,7 @@ public void GetCustomPrebuiltDomainEntityRoles() { Name = "simple role" }); - var roles = await client.Model.GetCustomPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListCustomPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteEntityAsync(GlobalAppId, "0.1", entityId); Assert.Equal("simple role", Assert.Single(roles).Name); @@ -769,7 +769,7 @@ public void DeleteSimpleEntityRole() Name = "simple role" }); await client.Model.DeleteEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteEntityAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); @@ -787,7 +787,7 @@ public void DeletePrebuiltEntityRole() Name = "simple role" }); await client.Model.DeletePrebuiltEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeletePrebuiltAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); @@ -812,7 +812,7 @@ public void DeleteClosedListEntityRole() Name = "simple role" }); await client.Model.DeleteClosedListEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetClosedListEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListClosedListEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteClosedListAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); @@ -834,7 +834,7 @@ public void DeleteRegexEntityRole() Name = "simple role" }); await client.Model.DeleteRegexEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetRegexEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListRegexEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteRegexEntityModelAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); @@ -862,7 +862,7 @@ public void DeleteCompositeEntityRole() Name = "simple role" }); await client.Model.DeleteCompositeEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetCompositeEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListCompositeEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteCompositeEntityAsync(GlobalAppId, "0.1", entityId); foreach (var added in prebuiltEntitiesAdded) { @@ -888,7 +888,7 @@ public void DeletePatternAnyEntityRole() Name = "simple role" }); await client.Model.DeletePatternAnyEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetPatternAnyEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListPatternAnyEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeletePatternAnyEntityModelAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); @@ -911,7 +911,7 @@ public void DeleteHierarchicalEntityRole() Name = "simple role" }); await client.Model.DeleteHierarchicalEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetHierarchicalEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListHierarchicalEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteHierarchicalEntityAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); @@ -934,7 +934,7 @@ public void DeleteCustomPrebuiltDomainEntityRole() Name = "simple role" }); await client.Model.DeleteCustomEntityRoleAsync(GlobalAppId, "0.1", entityId, roleId); - var roles = await client.Model.GetCustomPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); + var roles = await client.Model.ListCustomPrebuiltEntityRolesAsync(GlobalAppId, "0.1", entityId); await client.Model.DeleteEntityAsync(GlobalAppId, "0.1", entityId); Assert.Empty(roles); diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelEntitiesTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelEntitiesTests.cs index e133cf791d23c..b7f05af465cd6 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelEntitiesTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelEntitiesTests.cs @@ -120,7 +120,7 @@ public void GetEntitySuggestions_ReturnsEmpty() Name = "Suggestions Entity Test" }); - var results = await client.Model.GetEntitySuggestionsAsync(GlobalAppId, versionId, entityId); + var results = await client.Model.ListEntitySuggestionsAsync(GlobalAppId, versionId, entityId); var count = results.SelectMany(o => o.EntityPredictions).Count(o => o.EntityName == "Suggestions Entity Test"); await client.Model.DeleteEntityAsync(GlobalAppId, versionId, entityId); diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelPatternAnyTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelPatternAnyTests.cs index b844fc2dc8308..94e8e34bb88c4 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelPatternAnyTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelPatternAnyTests.cs @@ -23,7 +23,7 @@ public void ListEntities() ExplicitList = new[] { "item" } }); - var results = await client.Model.GetPatternAnyEntityInfosAsync(GlobalAppId, versionId); + var results = await client.Model.ListPatternAnyEntityInfosAsync(GlobalAppId, versionId); var model = results.FirstOrDefault(r => r.Name == "Pattern.Any entity"); Assert.NotNull(model); @@ -119,7 +119,7 @@ public void DeleteEntity() await client.Model.DeletePatternAnyEntityModelAsync(GlobalAppId, versionId, entityId); - var results = await client.Model.GetPatternAnyEntityInfosAsync(GlobalAppId, versionId); + var results = await client.Model.ListPatternAnyEntityInfosAsync(GlobalAppId, versionId); Assert.DoesNotContain(results, o => o.Id == entityId); }); diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelRegexEntitiesTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelRegexEntitiesTests.cs index 54987e6149276..b4e39fb10030b 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelRegexEntitiesTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/ModelRegexEntitiesTests.cs @@ -15,7 +15,7 @@ public void GetRegexEntities() UseClientFor(async client => { var regexEntityId = await client.Model.CreateRegexEntityModelAsync(GlobalAppId, versionId, GetRegexEntitySample()); - var regexEntities = await client.Model.GetRegexEntityInfosAsync(GlobalAppId, versionId); + var regexEntities = await client.Model.ListRegexEntityInfosAsync(GlobalAppId, versionId); await client.Model.DeleteRegexEntityModelAsync(GlobalAppId, versionId, regexEntityId); Assert.NotEmpty(regexEntities); @@ -79,7 +79,7 @@ public void DeleteRegexEntity() var regexEntityId = await client.Model.CreateRegexEntityModelAsync(GlobalAppId, versionId, GetRegexEntitySample()); await client.Model.DeleteRegexEntityModelAsync(GlobalAppId, versionId, regexEntityId); - var regexEntities = await client.Model.GetRegexEntityInfosAsync(GlobalAppId, versionId); + var regexEntities = await client.Model.ListRegexEntityInfosAsync(GlobalAppId, versionId); Assert.DoesNotContain(regexEntities, o => o.Id == regexEntityId); }); diff --git a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/PatternsTests.cs b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/PatternsTests.cs index 821df5d79592f..a163ab37861b1 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/PatternsTests.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Language/LUIS/Authoring.Tests/Luis/PatternsTests.cs @@ -153,7 +153,7 @@ public void GetPatterns() }; var result = await client.Pattern.BatchAddPatternsAsync(GlobalAppId, "0.1", patternsToAdd); - var patterns = await client.Pattern.GetPatternsAsync(GlobalAppId, "0.1"); + var patterns = await client.Pattern.ListPatternsAsync(GlobalAppId, "0.1"); await client.Pattern.DeletePatternsAsync(GlobalAppId, "0.1", result.Select(p => p.Id).ToList()); foreach (var added in prebuiltEntitiesAdded) @@ -191,7 +191,7 @@ public void GetIntentPatterns() }; var result = await client.Pattern.BatchAddPatternsAsync(GlobalAppId, "0.1", patternsToAdd); - var patterns = await client.Pattern.GetIntentPatternsAsync(GlobalAppId, "0.1", GlobalNoneId); + var patterns = await client.Pattern.ListIntentPatternsAsync(GlobalAppId, "0.1", GlobalNoneId); await client.Pattern.DeletePatternsAsync(GlobalAppId, "0.1", result.Select(p => p.Id).ToList()); foreach (var added in prebuiltEntitiesAdded) @@ -225,7 +225,7 @@ public void DeletePattern() var pattern = new PatternRuleCreateObject { Intent = "None", Pattern = "This is a {datetimeV2}" }; var result = await client.Pattern.AddPatternAsync(GlobalAppId, "0.1", pattern); await client.Pattern.DeletePatternAsync(GlobalAppId, "0.1", result.Id.Value); - var existingPatterns = await client.Pattern.GetPatternsAsync(GlobalAppId, "0.1"); + var existingPatterns = await client.Pattern.ListPatternsAsync(GlobalAppId, "0.1"); foreach (var added in prebuiltEntitiesAdded) { await client.Model.DeletePrebuiltAsync(GlobalAppId, version, added.Id); @@ -255,7 +255,7 @@ public void DeletePatterns() var result = await client.Pattern.BatchAddPatternsAsync(GlobalAppId, "0.1", patterns); await client.Pattern.DeletePatternsAsync(GlobalAppId, "0.1", result.Select(p => p.Id).ToList()); - var existingPatterns = await client.Pattern.GetPatternsAsync(GlobalAppId, "0.1"); + var existingPatterns = await client.Pattern.ListPatternsAsync(GlobalAppId, "0.1"); foreach (var added in prebuiltEntitiesAdded) { await client.Model.DeletePrebuiltAsync(GlobalAppId, version, added.Id);