Skip to content

Commit

Permalink
Fixing luis runtime sdk failing tests (#5750)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebadr authored and dsgouda committed Apr 10, 2019
1 parent ca1dbe9 commit 534ecdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void Prediction_Post()
UseClientFor(async client =>
{
var utterance = "this is a test with post";
var result = await client.Prediction.ResolveAsync(appId, utterance);
var result = await client.Prediction.ResolveAsync(System.Guid.Parse(appId), utterance);

Assert.Equal("None", result.TopScoringIntent.Intent);
Assert.Equal(utterance, result.Query);
Expand All @@ -27,7 +27,7 @@ public void Prediction_WithSpellCheck()
UseClientFor(async client =>
{
var utterance = "helo, what dai is todey?";
var result = await client.Prediction.ResolveAsync(appId, utterance, spellCheck: true, bingSpellCheckSubscriptionKey: "00000000000000000000000000000000");
var result = await client.Prediction.ResolveAsync(System.Guid.Parse(appId), utterance, spellCheck: true, bingSpellCheckSubscriptionKey: "00000000000000000000000000000000");

Assert.True(!string.IsNullOrWhiteSpace(result.AlteredQuery));
Assert.Equal("hello, what day is today?", result.AlteredQuery);
Expand All @@ -44,7 +44,7 @@ public void Prediction_InvalidKey_ThrowsAPIErrorException()
{
var ex = await Assert.ThrowsAsync<APIErrorException>(async () =>
{
await client.Prediction.ResolveWithHttpMessagesAsync(appId, "this is a test with post", customHeaders: headers);
await client.Prediction.ResolveWithHttpMessagesAsync(System.Guid.Parse(appId), "this is a test with post", customHeaders: headers);
});

Assert.Equal("401", ex.Body.StatusCode);
Expand All @@ -59,7 +59,7 @@ public void Prediction_QueryTooLong_ThrowsValidationException()
var query = string.Empty.PadLeft(501, 'x');
var ex = await Assert.ThrowsAsync<ValidationException>(async () =>
{
await client.Prediction.ResolveWithHttpMessagesAsync(appId, query);
await client.Prediction.ResolveWithHttpMessagesAsync(System.Guid.Parse(appId), query);
});

Assert.Equal("query", ex.Target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" />
</ItemGroup>
Expand Down

0 comments on commit 534ecdd

Please sign in to comment.