public async Task ReturnFailureOnBadResult() { var error = new ErrorMessageGenerator().GenerateError(HttpStatusCode.BadRequest, Error); var expected = SentimentResult.Build(error); var sut = TextAnalyticsTestHelper.BuildSut(TextAnalyticsTestHelper.GetErrorMessage(Error)); var result = await sut.GetSentimentAsync(Input); Assert.AreEqual(expected, result); }
public async Task ReturnFailureOnBadResult() { var error = new ErrorMessageGenerator().GenerateError(HttpStatusCode.BadRequest, Error); var expected = KeyPhraseResult.Build(error); var sut = TextAnalyticsTestHelper.BuildSut(TextAnalyticsTestHelper.GetErrorMessage(Error)); var result = await sut.GetKeyPhrasesAsync(Input); Assert.AreEqual(expected, result); }
public async Task ReturnAllFailureOnBadResult() { var err = new ErrorMessageGenerator().GenerateError(HttpStatusCode.BadRequest, Error); var expected = new Dictionary <string, SentimentResult> { { "1", SentimentResult.Build(err) }, { "2", SentimentResult.Build(err) }, { "3", SentimentResult.Build(err) }, { "4", SentimentResult.Build(err) } }; var sut = TextAnalyticsTestHelper.BuildSut(TextAnalyticsTestHelper.GetErrorMessage(Error)); var result = await sut.GetBatchSentimentAsync(this._input); CollectionAssert.AreEqual(expected, result.ToList()); }
public async Task ReturnAllFailureOnBadResult() { var err = new ErrorMessageGenerator().GenerateError(HttpStatusCode.BadRequest, Error); var expected = new Dictionary<string, SentimentResult> { { "1", SentimentResult.Build(err) }, { "2", SentimentResult.Build(err) }, { "3", SentimentResult.Build(err) }, { "4", SentimentResult.Build(err) } }; var sut = TextAnalyticsTestHelper.BuildSut(TextAnalyticsTestHelper.GetErrorMessage(Error)); var result = await sut.GetBatchSentimentAsync(this._input); CollectionAssert.AreEqual(expected, result.ToList()); }