Skip to content

Commit

Permalink
[textanalytics] fix AnalyzeOperationBatchWithStatisticsTest (#18516)
Browse files Browse the repository at this point in the history
Co-authored-by: NourEldin Yasser <noursalem95@gmail.com>
  • Loading branch information
a-noyass and nsalem95 authored Feb 10, 2021
1 parent b571b81 commit 632431d
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 390 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ public async Task AnalyzeOperationBatchWithPHIDomain()
}

[Test]
[Ignore("The statstics is not being returned from the service - https://github.com/Azure/azure-sdk-for-net/issues/16839")]
public async Task AnalyzeOperationBatchWithStatisticsTest()
{
TextAnalyticsClient client = GetClient();
Expand All @@ -401,6 +400,10 @@ public async Task AnalyzeOperationBatchWithStatisticsTest()
Language = "en",
},
new TextDocumentInput("2", "Mi perro y mi gato tienen que ir al veterinario.")
{
Language = "es",
},
new TextDocumentInput("3", "")
{
Language = "es",
}
Expand Down Expand Up @@ -428,12 +431,15 @@ public async Task AnalyzeOperationBatchWithStatisticsTest()

Assert.IsNotNull(result);

Assert.AreEqual(2, result.Count);
Assert.AreEqual(3, result.Count);

Assert.AreEqual(3, result.Statistics.DocumentCount);
Assert.AreEqual(2, result.Statistics.TransactionCount);
Assert.AreEqual(2, result.Statistics.ValidDocumentCount);
Assert.AreEqual(1, result.Statistics.InvalidDocumentCount);

// TODO - Update this once service start returning statistics.
// TODO - Add Other request level statistics.
Assert.AreEqual(0, result[0].Statistics.CharacterCount);
Assert.AreEqual(0, result[0].Statistics.TransactionCount);
Assert.AreEqual(51, result[0].Statistics.CharacterCount);
Assert.AreEqual(1, result[0].Statistics.TransactionCount);
}
}
}
Loading

0 comments on commit 632431d

Please sign in to comment.