public void GIVENActivity_WHENToSentimentInputIsInvoked_THENSentimentInputIsBeingReturned(
            IActivityAdapter activity)
        {
            // Arrange
            const int    expectedNumberOfDocuments = 1;
            const string expectedSentimentInputId  = "1";

            // Act
            var actualResult = activity.ToSentimentInput();

            // Assert
            actualResult.Documents.Should().HaveCount(expectedNumberOfDocuments);
            actualResult.Documents.Should().ContainSingle(i =>
                                                          i.Text == activity.MessageActivity.Text &&
                                                          i.Id == expectedSentimentInputId);
        }
        public async Task <double?> GetSentiment(IActivityAdapter activity)
        {
            if (activity == null)
            {
                throw new ArgumentNullException(nameof(activity));
            }

            if (this.disposed)
            {
                throw new ObjectDisposedException(this.GetType().FullName);
            }

            MultiLanguageBatchInput input  = activity.ToSentimentInput();
            SentimentBatchResult    result = await this.textAnalyticsClient.SentimentAsync(null, input)
                                             .ConfigureAwait(false);

            return(result?.Documents[0].Score);
        }