Skip to content

Commit

Permalink
Fix Authoring SDK Tests (Azure#5641)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebadr authored and mentat9 committed Jun 10, 2019
1 parent 1c3e48d commit 3fe8dd8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void UpdateSettings()
await client.Apps.UpdateSettingsAsync(testAppId, new ApplicationSettingUpdateObject
{
PublicProperty = true
IsPublic = true
});
// Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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)
{
Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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)
{
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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)
{
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3fe8dd8

Please sign in to comment.