diff --git a/libraries/Microsoft.Bot.Builder.Testing/Microsoft.Bot.Builder.Testing.csproj b/libraries/Microsoft.Bot.Builder.Testing/Microsoft.Bot.Builder.Testing.csproj
index a73585f315..7e08fd3dbd 100644
--- a/libraries/Microsoft.Bot.Builder.Testing/Microsoft.Bot.Builder.Testing.csproj
+++ b/libraries/Microsoft.Bot.Builder.Testing/Microsoft.Bot.Builder.Testing.csproj
@@ -25,7 +25,7 @@
-
+
diff --git a/libraries/Microsoft.Bot.Streaming/Microsoft.Bot.Streaming.csproj b/libraries/Microsoft.Bot.Streaming/Microsoft.Bot.Streaming.csproj
index 2eec89b6b3..09c9430bec 100644
--- a/libraries/Microsoft.Bot.Streaming/Microsoft.Bot.Streaming.csproj
+++ b/libraries/Microsoft.Bot.Streaming/Microsoft.Bot.Streaming.csproj
@@ -11,7 +11,7 @@
- netstandard2.0
+ netstandard2.0;net6.0;net8.0
Microsoft.Bot.Streaming
Streaming library for the Bot Framework SDK
Streaming library for the Bot Framework SDK
@@ -26,9 +26,20 @@
$(NoWarn);
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/libraries/Microsoft.Bot.Streaming/Payloads/RequestManager.cs b/libraries/Microsoft.Bot.Streaming/Payloads/RequestManager.cs
index c1601f8916..b2d29cbf7c 100644
--- a/libraries/Microsoft.Bot.Streaming/Payloads/RequestManager.cs
+++ b/libraries/Microsoft.Bot.Streaming/Payloads/RequestManager.cs
@@ -56,7 +56,7 @@ public async Task GetResponseAsync(Guid requestId, Cancellation
return null;
}
- if (cancellationToken == null)
+ if (cancellationToken == default)
{
cancellationToken = CancellationToken.None;
}
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookAdapterTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookAdapterTests.cs
index 8124bc235f..961f58183e 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookAdapterTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookAdapterTests.cs
@@ -34,7 +34,7 @@ public void ConstructorShouldFailWithNullClient()
}
[Fact]
- public async void ContinueConversationAsyncShouldSucceed()
+ public async Task ContinueConversationAsyncShouldSucceed()
{
var callbackInvoked = false;
var facebookAdapter = new FacebookAdapter(new FacebookClientWrapper(_testOptions), _adapterOptions);
@@ -50,7 +50,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ContinueConversationAsyncShouldFailWithNullConversationReference()
+ public async Task ContinueConversationAsyncShouldFailWithNullConversationReference()
{
var facebookAdapter = new FacebookAdapter(new FacebookClientWrapper(_testOptions), _adapterOptions);
Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
@@ -62,7 +62,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ContinueConversationAsyncShouldFailWithNullLogic()
+ public async Task ContinueConversationAsyncShouldFailWithNullLogic()
{
var facebookAdapter = new FacebookAdapter(new FacebookClientWrapper(_testOptions), _adapterOptions);
var conversationReference = new ConversationReference();
@@ -83,7 +83,7 @@ public async Task DeleteActivityAsyncShouldThrowNotImplementedException()
}
[Fact]
- public async void ProcessAsyncShouldSucceedWithCorrectData()
+ public async Task ProcessAsyncShouldSucceedWithCorrectData()
{
var payload = File.ReadAllText(Directory.GetCurrentDirectory() + @"/Files/Payload.json");
var facebookClientWrapper = new Mock(_testOptions);
@@ -102,7 +102,7 @@ public async void ProcessAsyncShouldSucceedWithCorrectData()
}
[Fact]
- public async void ProcessAsyncShouldSucceedWithStandbyMessages()
+ public async Task ProcessAsyncShouldSucceedWithStandbyMessages()
{
var payload = File.ReadAllText(Directory.GetCurrentDirectory() + @"/Files/PayloadWithStandby.json");
var facebookClientWrapper = new Mock(_testOptions);
@@ -120,7 +120,7 @@ public async void ProcessAsyncShouldSucceedWithStandbyMessages()
}
[Fact]
- public async void ProcessAsyncShouldSucceedWithReferralMessages()
+ public async Task ProcessAsyncShouldSucceedWithReferralMessages()
{
var payload = File.ReadAllText(Directory.GetCurrentDirectory() + @"/Files/PayloadWithReferral.json");
var facebookClientWrapper = new Mock(_testOptions);
@@ -138,7 +138,7 @@ public async void ProcessAsyncShouldSucceedWithReferralMessages()
}
[Fact]
- public async void ProcessAsyncShouldVerifyWebhookOnHubModeSubscribe()
+ public async Task ProcessAsyncShouldVerifyWebhookOnHubModeSubscribe()
{
var testOptionsVerifyEnabled = new FacebookAdapterOptions()
{
@@ -190,7 +190,7 @@ public async Task ProcessAsyncShouldThrowExceptionWithUnverifiedSignature()
}
[Fact]
- public async void SendActivitiesAsyncShouldSucceedWithActivityTypeMessage()
+ public async Task SendActivitiesAsyncShouldSucceedWithActivityTypeMessage()
{
const string testResponse = "Test Response";
var facebookClientWrapper = new Mock(_testOptions);
@@ -219,7 +219,7 @@ public async void SendActivitiesAsyncShouldSucceedWithActivityTypeMessage()
}
[Fact]
- public async void SendActivitiesAsyncShouldSucceedWithActivityTypeMessageAndAttachments()
+ public async Task SendActivitiesAsyncShouldSucceedWithActivityTypeMessageAndAttachments()
{
const string testResponse = "Test Response";
var facebookClientWrapper = new Mock(_testOptions);
@@ -251,7 +251,7 @@ public async void SendActivitiesAsyncShouldSucceedWithActivityTypeMessageAndAtta
}
[Fact]
- public async void SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActivityTypeNotMessage()
+ public async Task SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActivityTypeNotMessage()
{
const string testResponse = "Test Response";
var facebookClientWrapper = new Mock(_testOptions);
@@ -283,7 +283,7 @@ public async void SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActiv
}
[Fact]
- public async void SendActivitiesAsyncShouldPostToFacebookOnPassThreadControl()
+ public async Task SendActivitiesAsyncShouldPostToFacebookOnPassThreadControl()
{
const string testResponse = "Test Response";
var facebookClientWrapper = new Mock(_testOptions);
@@ -315,7 +315,7 @@ public async void SendActivitiesAsyncShouldPostToFacebookOnPassThreadControl()
}
[Fact]
- public async void SendActivitiesAsyncShouldPostToFacebookOnTakeThreadControl()
+ public async Task SendActivitiesAsyncShouldPostToFacebookOnTakeThreadControl()
{
const string testResponse = "Test Response";
var facebookClientWrapper = new Mock(_testOptions);
@@ -347,7 +347,7 @@ public async void SendActivitiesAsyncShouldPostToFacebookOnTakeThreadControl()
}
[Fact]
- public async void SendActivitiesAsyncShouldPostToFacebookOnRequestThreadControl()
+ public async Task SendActivitiesAsyncShouldPostToFacebookOnRequestThreadControl()
{
const string testResponse = "Test Response";
var facebookClientWrapper = new Mock(_testOptions);
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookWrapperTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookWrapperTests.cs
index b7ea05909c..9191213034 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookWrapperTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/FacebookWrapperTests.cs
@@ -8,6 +8,7 @@
using System.Net.Http;
using System.Text;
using System.Threading;
+using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Moq;
using Newtonsoft.Json;
@@ -64,7 +65,7 @@ public void VerifySignatureShouldReturnFalseWithInvalidRequestHash()
}
[Fact]
- public async void SendMessageAsyncShouldThrowAnExceptionWithWrongPath()
+ public async Task SendMessageAsyncShouldThrowAnExceptionWithWrongPath()
{
var facebookMessageJson = File.ReadAllText(Directory.GetCurrentDirectory() + @"/Files/FacebookMessages.json");
var facebookMessage = JsonConvert.DeserializeObject>(facebookMessageJson)[5];
@@ -77,7 +78,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void SendMessageAsyncShouldThrowAnExceptionWithNullPath()
+ public async Task SendMessageAsyncShouldThrowAnExceptionWithNullPath()
{
var facebookMessageJson = File.ReadAllText(Directory.GetCurrentDirectory() + @"/Files/FacebookMessages.json");
var facebookMessage = JsonConvert.DeserializeObject>(facebookMessageJson)[5];
@@ -90,7 +91,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void SendMessageAsyncShouldThrowAnExceptionWithNullPayload()
+ public async Task SendMessageAsyncShouldThrowAnExceptionWithNullPayload()
{
var facebookWrapper = new FacebookClientWrapper(_testOptions);
@@ -101,7 +102,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void VerifyWebhookAsyncShouldSendOkWhenVerified()
+ public async Task VerifyWebhookAsyncShouldSendOkWhenVerified()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
var httpRequest = new Mock();
@@ -124,7 +125,7 @@ public async void VerifyWebhookAsyncShouldSendOkWhenVerified()
}
[Fact]
- public async void VerifyWebhookAsyncShouldSendUnauthorizedWhenNotVerified()
+ public async Task VerifyWebhookAsyncShouldSendUnauthorizedWhenNotVerified()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
var httpRequest = new Mock();
@@ -147,7 +148,7 @@ public async void VerifyWebhookAsyncShouldSendUnauthorizedWhenNotVerified()
}
[Fact]
- public async void VerifyWebhookAsyncShouldThrowExceptionWithNullRequest()
+ public async Task VerifyWebhookAsyncShouldThrowExceptionWithNullRequest()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
var httpResponse = new Mock();
@@ -156,7 +157,7 @@ public async void VerifyWebhookAsyncShouldThrowExceptionWithNullRequest()
}
[Fact]
- public async void VerifyWebhookAsyncShouldThrowExceptionWithNullResponse()
+ public async Task VerifyWebhookAsyncShouldThrowExceptionWithNullResponse()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
var httpRequest = new Mock();
@@ -165,7 +166,7 @@ public async void VerifyWebhookAsyncShouldThrowExceptionWithNullResponse()
}
[Fact]
- public async void PassThreadControlAsyncShouldThrowExceptionWithNullTargetAppId()
+ public async Task PassThreadControlAsyncShouldThrowExceptionWithNullTargetAppId()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
@@ -173,7 +174,7 @@ public async void PassThreadControlAsyncShouldThrowExceptionWithNullTargetAppId(
}
[Fact]
- public async void PassThreadControlAsyncShouldThrowExceptionWithNullUserId()
+ public async Task PassThreadControlAsyncShouldThrowExceptionWithNullUserId()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
@@ -181,7 +182,7 @@ public async void PassThreadControlAsyncShouldThrowExceptionWithNullUserId()
}
[Fact]
- public async void RequestThreadControlAsyncShouldThrowExceptionWithNullUserId()
+ public async Task RequestThreadControlAsyncShouldThrowExceptionWithNullUserId()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
@@ -189,7 +190,7 @@ public async void RequestThreadControlAsyncShouldThrowExceptionWithNullUserId()
}
[Fact]
- public async void TakeThreadControlAsyncShouldThrowExceptionWithNullUserId()
+ public async Task TakeThreadControlAsyncShouldThrowExceptionWithNullUserId()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
@@ -197,7 +198,7 @@ public async void TakeThreadControlAsyncShouldThrowExceptionWithNullUserId()
}
[Fact]
- public async void PostToFacebookApiAsyncShouldThrowExceptionWithNullPostType()
+ public async Task PostToFacebookApiAsyncShouldThrowExceptionWithNullPostType()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
@@ -205,7 +206,7 @@ public async void PostToFacebookApiAsyncShouldThrowExceptionWithNullPostType()
}
[Fact]
- public async void PostToFacebookApiAsyncShouldThrowExceptionWithNullContent()
+ public async Task PostToFacebookApiAsyncShouldThrowExceptionWithNullContent()
{
var facebookClientWrapper = new FacebookClientWrapper(_testOptions);
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/Microsoft.Bot.Builder.Adapters.Facebook.Tests.csproj b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/Microsoft.Bot.Builder.Adapters.Facebook.Tests.csproj
index 145745d7fe..e904763f11 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/Microsoft.Bot.Builder.Adapters.Facebook.Tests.csproj
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Facebook.Tests/Microsoft.Bot.Builder.Adapters.Facebook.Tests.csproj
@@ -18,7 +18,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/Microsoft.Bot.Builder.Adapters.Slack.Tests.csproj b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/Microsoft.Bot.Builder.Adapters.Slack.Tests.csproj
index 57ba5f841c..ce21f6f96c 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/Microsoft.Bot.Builder.Adapters.Slack.Tests.csproj
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/Microsoft.Bot.Builder.Adapters.Slack.Tests.csproj
@@ -20,7 +20,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/SlackAdapterTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/SlackAdapterTests.cs
index 369f4392aa..b2bbe11a24 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/SlackAdapterTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Slack.Tests/SlackAdapterTests.cs
@@ -405,7 +405,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullHttpRequest()
+ public async Task ProcessAsyncShouldFailWithNullHttpRequest()
{
var slackApi = new Mock(_testOptions);
slackApi.Setup(x => x.TestAuthAsync(It.IsAny())).Returns(Task.FromResult("mockedUserId"));
@@ -421,7 +421,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullHttpResponse()
+ public async Task ProcessAsyncShouldFailWithNullHttpResponse()
{
var slackApi = new Mock(_testOptions);
slackApi.Setup(x => x.TestAuthAsync(It.IsAny())).Returns(Task.FromResult("mockedUserId"));
@@ -437,7 +437,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullBot()
+ public async Task ProcessAsyncShouldFailWithNullBot()
{
var slackApi = new Mock(_testOptions);
slackApi.Setup(x => x.TestAuthAsync(It.IsAny())).Returns(Task.FromResult("mockedUserId"));
@@ -543,7 +543,7 @@ public async Task ProcessAsyncShouldSucceedWithUnknownEventType()
await slackAdapter.ProcessAsync(httpRequest.Object, httpResponse.Object, new Mock().Object, default);
- Assert.Equal(httpResponse.Object.StatusCode, (int)HttpStatusCode.OK);
+ Assert.Equal((int)HttpStatusCode.OK, httpResponse.Object.StatusCode);
}
[Fact]
@@ -559,7 +559,7 @@ public async Task ProcessAsyncShouldSucceedWithReactionAddedEventType()
await slackAdapter.ProcessAsync(httpRequest.Object, httpResponse.Object, new Mock().Object, default);
- Assert.Equal(httpResponse.Object.StatusCode, (int)HttpStatusCode.OK);
+ Assert.Equal((int)HttpStatusCode.OK, httpResponse.Object.StatusCode);
}
[Fact]
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/Microsoft.Bot.Builder.Adapters.Twilio.Tests.csproj b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/Microsoft.Bot.Builder.Adapters.Twilio.Tests.csproj
index d8d266b5df..5a475e9ac1 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/Microsoft.Bot.Builder.Adapters.Twilio.Tests.csproj
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/Microsoft.Bot.Builder.Adapters.Twilio.Tests.csproj
@@ -16,7 +16,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioAdapterTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioAdapterTests.cs
index 7b48ee078b..1eae6d52d8 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioAdapterTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioAdapterTests.cs
@@ -32,7 +32,7 @@ public void ConstructorShouldFailWithNullTwilioApiWrapper()
}
[Fact]
- public async void SendActivitiesAsyncShouldSucceed()
+ public async Task SendActivitiesAsyncShouldSucceed()
{
var activity = new Mock().SetupAllProperties();
activity.Object.Type = "message";
@@ -46,13 +46,13 @@ public async void SendActivitiesAsyncShouldSucceed()
twilioApi.Setup(x => x.SendMessageAsync(It.IsAny(), default)).Returns(Task.FromResult(resourceIdentifier));
var twilioAdapter = new TwilioAdapter(twilioApi.Object, _adapterOptions);
- var resourceResponses = await twilioAdapter.SendActivitiesAsync(null, new Activity[] { activity.Object }, default).ConfigureAwait(false);
+ var resourceResponses = await twilioAdapter.SendActivitiesAsync(null, new Activity[] { activity.Object }, default);
Assert.True(resourceResponses[0].Id == resourceIdentifier);
}
[Fact]
- public async void SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActivityTypeNotMessage()
+ public async Task SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActivityTypeNotMessage()
{
var activity = new Mock().SetupAllProperties();
activity.Object.Type = ActivityTypes.Trace;
@@ -65,13 +65,13 @@ public async void SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActiv
twilioApi.Setup(x => x.SendMessageAsync(It.IsAny(), default)).Returns(Task.FromResult(resourceIdentifier));
var twilioAdapter = new TwilioAdapter(twilioApi.Object, _adapterOptions);
- var resourceResponses = await twilioAdapter.SendActivitiesAsync(null, new Activity[] { activity.Object }, default).ConfigureAwait(false);
+ var resourceResponses = await twilioAdapter.SendActivitiesAsync(null, new Activity[] { activity.Object }, default);
Assert.True(resourceResponses.Length == 0);
}
[Fact]
- public async void ProcessAsyncShouldSucceedWithHttpBody()
+ public async Task ProcessAsyncShouldSucceedWithHttpBody()
{
var payload = File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/NoMediaPayload.txt"));
var stream = new MemoryStream(Encoding.UTF8.GetBytes(payload.ToString()));
@@ -102,7 +102,7 @@ public async void ProcessAsyncShouldSucceedWithHttpBody()
}
[Fact]
- public async void ProcessAsyncShouldSucceedWithNullHttpBody()
+ public async Task ProcessAsyncShouldSucceedWithNullHttpBody()
{
var payload = File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/NoMediaPayload.txt"));
var stream = new MemoryStream(Encoding.UTF8.GetBytes(payload.ToString()));
@@ -133,7 +133,7 @@ public async void ProcessAsyncShouldSucceedWithNullHttpBody()
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullHttpRequest()
+ public async Task ProcessAsyncShouldFailWithNullHttpRequest()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
var httpResponse = new Mock();
@@ -146,7 +146,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullHttpResponse()
+ public async Task ProcessAsyncShouldFailWithNullHttpResponse()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
var httpRequest = new Mock();
@@ -159,7 +159,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullBot()
+ public async Task ProcessAsyncShouldFailWithNullBot()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
var httpRequest = new Mock();
@@ -172,7 +172,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void UpdateActivityAsyncShouldThrowNotSupportedException()
+ public async Task UpdateActivityAsyncShouldThrowNotSupportedException()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
var activity = new Activity();
@@ -187,7 +187,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void DeleteActivityAsyncShouldThrowNotSupportedException()
+ public async Task DeleteActivityAsyncShouldThrowNotSupportedException()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
var activity = new Activity();
@@ -203,7 +203,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ContinueConversationAsyncShouldSucceed()
+ public async Task ContinueConversationAsyncShouldSucceed()
{
var callbackInvoked = false;
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
@@ -221,7 +221,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ContinueConversationAsyncShouldFailWithNullConversationReference()
+ public async Task ContinueConversationAsyncShouldFailWithNullConversationReference()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
@@ -234,7 +234,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ContinueConversationAsyncShouldFailWithNullLogic()
+ public async Task ContinueConversationAsyncShouldFailWithNullLogic()
{
var twilioAdapter = new TwilioAdapter(new Mock(_testOptions).Object, _adapterOptions);
var conversationReference = new ConversationReference();
@@ -243,7 +243,7 @@ public async void ContinueConversationAsyncShouldFailWithNullLogic()
}
[Fact]
- public async void AdapterOptionsValidateFalseShouldNotCallValidateSignature()
+ public async Task AdapterOptionsValidateFalseShouldNotCallValidateSignature()
{
var payload = File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/NoMediaPayload.txt"));
var stream = new MemoryStream(Encoding.UTF8.GetBytes(payload.ToString()));
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioHelperTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioHelperTests.cs
index 79501aec98..4029c52f81 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioHelperTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Twilio.Tests/TwilioHelperTests.cs
@@ -148,7 +148,7 @@ public void PayloadToActivityShouldReturnActivityAttachmentsWithNumMediaGreaterT
var activity = TwilioHelper.PayloadToActivity(dictionaryPayload);
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
}
[Fact]
@@ -160,7 +160,7 @@ public void PayloadToActivityShouldNotThrowKeyNotFoundExceptionWithNumMediaGreat
var activity = TwilioHelper.PayloadToActivity(dictionaryPayload);
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
}
[Fact]
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/Microsoft.Bot.Builder.Adapters.Webex.Tests.csproj b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/Microsoft.Bot.Builder.Adapters.Webex.Tests.csproj
index a1f25325c6..2aba527eea 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/Microsoft.Bot.Builder.Adapters.Webex.Tests.csproj
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/Microsoft.Bot.Builder.Adapters.Webex.Tests.csproj
@@ -14,7 +14,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexAdapterTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexAdapterTests.cs
index 88754ef811..a47467cb29 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexAdapterTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexAdapterTests.cs
@@ -37,7 +37,7 @@ public void ConstructorShouldFailWithNullClient()
}
[Fact]
- public async void ContinueConversationAsyncShouldSucceed()
+ public async Task ContinueConversationAsyncShouldSucceed()
{
var callbackInvoked = false;
@@ -54,7 +54,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ContinueConversationAsyncShouldFailWithNullConversationReference()
+ public async Task ContinueConversationAsyncShouldFailWithNullConversationReference()
{
var webexAdapter = new WebexAdapter(new Mock(_testOptions).Object, _adapterOptions);
@@ -67,7 +67,7 @@ Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
}
[Fact]
- public async void ContinueConversationAsyncShouldFailWithNullLogic()
+ public async Task ContinueConversationAsyncShouldFailWithNullLogic()
{
var webexAdapter = new WebexAdapter(new Mock(_testOptions).Object, _adapterOptions);
var conversationReference = new ConversationReference();
@@ -76,7 +76,7 @@ public async void ContinueConversationAsyncShouldFailWithNullLogic()
}
[Fact]
- public async void ProcessAsyncWithEvenTypeCreatedShouldSucceed()
+ public async Task ProcessAsyncWithEvenTypeCreatedShouldSucceed()
{
var message = JsonConvert.DeserializeObject(File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"\Files\Message.json")));
var payload = File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/Payload.json"));
@@ -107,7 +107,7 @@ public async void ProcessAsyncWithEvenTypeCreatedShouldSucceed()
}
[Fact]
- public async void ProcessAsyncWithEvenTypeUpdatedShouldSucceed()
+ public async Task ProcessAsyncWithEvenTypeUpdatedShouldSucceed()
{
var webexApi = new Mock(_testOptions);
webexApi.SetupAllProperties();
@@ -136,7 +136,7 @@ public async void ProcessAsyncWithEvenTypeUpdatedShouldSucceed()
}
[Fact]
- public async void ProcessAsyncWithAttachmentActionsShouldSucceed()
+ public async Task ProcessAsyncWithAttachmentActionsShouldSucceed()
{
var message = JsonConvert.DeserializeObject(File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/MessageWithInputs.json")));
var payload = File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/PayloadAttachmentActions.json"));
@@ -167,7 +167,7 @@ public async void ProcessAsyncWithAttachmentActionsShouldSucceed()
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullHttpRequest()
+ public async Task ProcessAsyncShouldFailWithNullHttpRequest()
{
var webexAdapter = new WebexAdapter(new Mock(_testOptions).Object, _adapterOptions);
var httpResponse = new Mock();
@@ -180,7 +180,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullHttpResponse()
+ public async Task ProcessAsyncShouldFailWithNullHttpResponse()
{
var webexAdapter = new WebexAdapter(new Mock(_testOptions).Object, _adapterOptions);
var httpRequest = new Mock();
@@ -193,7 +193,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNullBot()
+ public async Task ProcessAsyncShouldFailWithNullBot()
{
var webexAdapter = new WebexAdapter(new Mock(_testOptions).Object, _adapterOptions);
var httpRequest = new Mock();
@@ -206,7 +206,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void ProcessAsyncShouldFailWithNonMatchingSignature()
+ public async Task ProcessAsyncShouldFailWithNonMatchingSignature()
{
var webexApi = new Mock(_testOptions);
webexApi.SetupAllProperties();
@@ -232,7 +232,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void UpdateActivityAsyncShouldThrowNotSupportedException()
+ public async Task UpdateActivityAsyncShouldThrowNotSupportedException()
{
var webexAdapter = new WebexAdapter(new Mock(_testOptions).Object, _adapterOptions);
@@ -247,7 +247,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void SendActivitiesAsyncNotNullToPersonEmailShouldSucceed()
+ public async Task SendActivitiesAsyncNotNullToPersonEmailShouldSucceed()
{
// Setup mocked Webex API client
const string expectedResponseId = "Mocked Response Id";
@@ -264,14 +264,14 @@ public async void SendActivitiesAsyncNotNullToPersonEmailShouldSucceed()
var turnContext = new TurnContext(webexAdapter, activity.Object);
- var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default).ConfigureAwait(false);
+ var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default);
// Assert the result
Assert.True(resourceResponse[0].Id == expectedResponseId);
}
[Fact]
- public async void SendActivitiesAsyncWithAttachmentShouldSucceed()
+ public async Task SendActivitiesAsyncWithAttachmentShouldSucceed()
{
// Setup mocked Webex API client
const string expectedResponseId = "Mocked Response Id";
@@ -292,14 +292,14 @@ public async void SendActivitiesAsyncWithAttachmentShouldSucceed()
var turnContext = new TurnContext(webexAdapter, activity.Object);
- var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default).ConfigureAwait(false);
+ var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default);
// Assert the result
Assert.True(resourceResponse[0].Id == expectedResponseId);
}
[Fact]
- public async void SendActivitiesAsyncWithAttachmentActionsShouldSucceed()
+ public async Task SendActivitiesAsyncWithAttachmentActionsShouldSucceed()
{
const string expectedResponseId = "Mocked Response Id";
var webexApi = new Mock(_testOptions);
@@ -318,13 +318,13 @@ public async void SendActivitiesAsyncWithAttachmentActionsShouldSucceed()
var turnContext = new TurnContext(webexAdapter, activity.Object);
- var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default).ConfigureAwait(false);
+ var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default);
Assert.True(resourceResponse[0].Id == expectedResponseId);
}
[Fact]
- public async void SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActivityTypeNotMessage()
+ public async Task SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActivityTypeNotMessage()
{
const string expectedResponseId = "Mocked Response Id";
var webexApi = new Mock(_testOptions);
@@ -339,13 +339,13 @@ public async void SendActivitiesAsyncShouldSucceedAndNoActivityReturnedWithActiv
var turnContext = new TurnContext(webexAdapter, activity.Object);
- var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default).ConfigureAwait(false);
+ var resourceResponse = await webexAdapter.SendActivitiesAsync(turnContext, new Activity[] { activity.Object }, default);
Assert.True(resourceResponse.Length == 0);
}
[Fact]
- public async void SendActivitiesAsyncShouldFailWithNullToPersonEmail()
+ public async Task SendActivitiesAsyncShouldFailWithNullToPersonEmail()
{
// Setup mocked Webex API client
const string expectedResponseId = "Mocked Response Id";
@@ -367,7 +367,7 @@ await Assert.ThrowsAsync(async () =>
}
[Fact]
- public async void DeleteActivityAsyncWithActivityIdShouldSucceed()
+ public async Task DeleteActivityAsyncWithActivityIdShouldSucceed()
{
var deletedMessages = 0;
diff --git a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexHelperTests.cs b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexHelperTests.cs
index 7bae4cdbae..de2fba8572 100644
--- a/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexHelperTests.cs
+++ b/tests/Adapters/Microsoft.Bot.Builder.Adapters.Webex.Tests/WebexHelperTests.cs
@@ -36,13 +36,13 @@ public void PayloadToActivityShouldReturnActivity()
}
[Fact]
- public async void GetDecryptedMessageAsyncShouldReturnNullWithNullPayload()
+ public async Task GetDecryptedMessageAsyncShouldReturnNullWithNullPayload()
{
Assert.Null(await WebexHelper.GetDecryptedMessageAsync(null, null, new CancellationToken()));
}
[Fact]
- public async void GetDecryptedMessageAsyncShouldSucceed()
+ public async Task GetDecryptedMessageAsyncShouldSucceed()
{
var testOptions = new WebexClientWrapperOptions("Test", new Uri("http://contoso.com"), "Test");
var payload = JsonConvert.DeserializeObject(File.ReadAllText(PathUtils.NormalizePath(Directory.GetCurrentDirectory() + @"/Files/Payload.json")));
diff --git a/tests/AdaptiveExpressions.Tests/AdaptiveExpressions.Tests.csproj b/tests/AdaptiveExpressions.Tests/AdaptiveExpressions.Tests.csproj
index 1ed4409807..2697c22c8d 100644
--- a/tests/AdaptiveExpressions.Tests/AdaptiveExpressions.Tests.csproj
+++ b/tests/AdaptiveExpressions.Tests/AdaptiveExpressions.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/AdaptiveExpressions.Tests/LRUCacheTest.cs b/tests/AdaptiveExpressions.Tests/LRUCacheTest.cs
index f29310f011..950067d87d 100644
--- a/tests/AdaptiveExpressions.Tests/LRUCacheTest.cs
+++ b/tests/AdaptiveExpressions.Tests/LRUCacheTest.cs
@@ -59,10 +59,10 @@ public void TestDPMemorySmall()
Assert.False(cache.TryGet(9998, out var result));
Assert.True(cache.TryGet(maxIdx - 1, out result));
- Assert.Equal(result, fib9999);
+ Assert.Equal(fib9999, result);
Assert.True(cache.TryGet(maxIdx, out result));
- Assert.Equal(result, fib100000);
+ Assert.Equal(fib100000, result);
}
[Fact]
@@ -87,10 +87,10 @@ public void TestDPMemoryLarge()
Assert.False(cache.TryGet(1, out var result));
Assert.True(cache.TryGet(maxIdx - 1, out result));
- Assert.Equal(result, fib9999);
+ Assert.Equal(fib9999, result);
Assert.True(cache.TryGet(maxIdx, out result));
- Assert.Equal(result, fib100000);
+ Assert.Equal(fib100000, result);
}
[Fact]
@@ -108,7 +108,7 @@ public async Task TestMultiThreadingAsync()
tasks.Add(Task.Run(() => StoreElement(cache, numOfOps, i)));
}
- await Task.WhenAll(tasks).ConfigureAwait(false);
+ await Task.WhenAll(tasks);
for (var i = numOfOps - numOfThreads; i < numOfOps; i++)
{
diff --git a/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/LRUCacheTest.cs b/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/LRUCacheTest.cs
index 252c219fb4..538ca703b9 100644
--- a/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/LRUCacheTest.cs
+++ b/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/LRUCacheTest.cs
@@ -59,10 +59,10 @@ public void TestDPMemorySmall()
Assert.False(cache.TryGet(9998, out var result));
Assert.True(cache.TryGet(maxIdx - 1, out result));
- Assert.Equal(result, fib9999);
+ Assert.Equal(fib9999, result);
Assert.True(cache.TryGet(maxIdx, out result));
- Assert.Equal(result, fib100000);
+ Assert.Equal(fib100000, result);
}
[Fact]
@@ -87,10 +87,10 @@ public void TestDPMemoryLarge()
Assert.False(cache.TryGet(1, out var result));
Assert.True(cache.TryGet(maxIdx - 1, out result));
- Assert.Equal(result, fib9999);
+ Assert.Equal(fib9999, result);
Assert.True(cache.TryGet(maxIdx, out result));
- Assert.Equal(result, fib100000);
+ Assert.Equal(fib100000, result);
}
[Fact]
@@ -108,7 +108,7 @@ public async Task TestMultiThreadingAsync()
tasks.Add(Task.Run(() => StoreElement(cache, numOfOps, i)));
}
- await Task.WhenAll(tasks).ConfigureAwait(false);
+ await Task.WhenAll(tasks);
for (var i = numOfOps - numOfThreads; i < numOfOps; i++)
{
diff --git a/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests.csproj b/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests.csproj
index 6bdb74c8c3..e03fc61c7d 100644
--- a/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests.csproj
+++ b/tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests/Microsoft.Bot.AdaptiveExpressions.Core.AOT.Tests.csproj
@@ -17,7 +17,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/LRUCacheTest.cs b/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/LRUCacheTest.cs
index 3b42b17015..00d1c8c788 100644
--- a/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/LRUCacheTest.cs
+++ b/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/LRUCacheTest.cs
@@ -59,10 +59,10 @@ public void TestDPMemorySmall()
Assert.False(cache.TryGet(9998, out var result));
Assert.True(cache.TryGet(maxIdx - 1, out result));
- Assert.Equal(result, fib9999);
+ Assert.Equal(fib9999, result);
Assert.True(cache.TryGet(maxIdx, out result));
- Assert.Equal(result, fib100000);
+ Assert.Equal(fib100000, result);
}
[Fact]
@@ -87,10 +87,10 @@ public void TestDPMemoryLarge()
Assert.False(cache.TryGet(1, out var result));
Assert.True(cache.TryGet(maxIdx - 1, out result));
- Assert.Equal(result, fib9999);
+ Assert.Equal(fib9999, result);
Assert.True(cache.TryGet(maxIdx, out result));
- Assert.Equal(result, fib100000);
+ Assert.Equal(fib100000, result);
}
[Fact]
@@ -108,7 +108,7 @@ public async Task TestMultiThreadingAsync()
tasks.Add(Task.Run(() => StoreElement(cache, numOfOps, i)));
}
- await Task.WhenAll(tasks).ConfigureAwait(false);
+ await Task.WhenAll(tasks);
for (var i = numOfOps - numOfThreads; i < numOfOps; i++)
{
diff --git a/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests.csproj b/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests.csproj
index 6da878a08f..52f15d80e2 100644
--- a/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests.csproj
+++ b/tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests/Microsoft.Bot.AdaptiveExpressions.Core.Tests.csproj
@@ -16,7 +16,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisOracleTests.cs b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisOracleTests.cs
index d1d843c187..17ac399561 100644
--- a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisOracleTests.cs
+++ b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisOracleTests.cs
@@ -303,7 +303,7 @@ public void TopIntentReturnsTopIntentIfScoreEqualsMinScore()
}
[Fact]
- public void UserAgentContainsProductVersion()
+ public async Task UserAgentContainsProductVersionAsync()
{
var application = new LuisApplication
{
@@ -328,7 +328,7 @@ public void UserAgentContainsProductVersion()
var turnContext = new TurnContext(adapter, activity);
- var recognizerResult = recognizer.RecognizeAsync(turnContext, CancellationToken.None).Result;
+ var recognizerResult = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
Assert.NotNull(recognizerResult);
var userAgent = clientHandler.UserAgent;
@@ -397,7 +397,7 @@ public async Task Telemetry_OverrideOnLogAsync()
{ "test", "testvalue" },
{ "foo", "foovalue" },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties);
// Assert
Assert.NotNull(result);
@@ -445,7 +445,7 @@ public async Task Telemetry_PiiLoggedAsync()
var recognizer = new LuisRecognizer(opts, clientHandler);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, null).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, null);
// Assert
Assert.NotNull(result);
@@ -492,7 +492,7 @@ public async Task Telemetry_NoPiiLoggedAsync()
var recognizer = new LuisRecognizer(options, clientHandler);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, null).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, null);
// Assert
Assert.NotNull(result);
@@ -544,7 +544,7 @@ public async Task Telemetry_OverrideOnDeriveAsync()
{ "test", "testvalue" },
{ "foo", "foovalue" },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties);
// Assert
Assert.NotNull(result);
@@ -602,7 +602,7 @@ public async Task Telemetry_OverrideFillAsync()
{ "boo", 2.11 },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics);
// Assert
Assert.NotNull(result);
@@ -655,7 +655,7 @@ public async Task Telemetry_NoOverrideAsync()
var recognizer = new LuisRecognizer(opts, clientHandler);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -699,7 +699,7 @@ public async Task Telemetry_Convert()
// Act
// Use a class the converts the Recognizer Result..
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -754,7 +754,7 @@ public async Task Telemetry_ConvertParms()
{ "luis", 1.0001 },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics, CancellationToken.None);
// Assert
Assert.NotNull(result);
diff --git a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisRecognizerTests.cs b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisRecognizerTests.cs
index 57523d1814..0a1fc698c2 100644
--- a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisRecognizerTests.cs
+++ b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisRecognizerTests.cs
@@ -26,17 +26,17 @@ public LuisRecognizerTests()
}
[Theory]
- [InlineData(false, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
- [InlineData(true, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
- [InlineData(false, 42, true, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
- [InlineData(false, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", true, false)]
- [InlineData(false, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, true)]
- [InlineData(null, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
+ [InlineData(false, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
+ [InlineData(true, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
+ [InlineData(false, 42.0, true, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
+ [InlineData(false, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", true, false)]
+ [InlineData(false, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, true)]
+ [InlineData(null, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
[InlineData(false, null, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
- [InlineData(false, 42, null, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
- [InlineData(false, 42, false, null, false, false)]
- [InlineData(false, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", null, false)]
- [InlineData(false, 42, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, null)]
+ [InlineData(false, 42.0, null, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, false)]
+ [InlineData(false, 42.0, false, null, false, false)]
+ [InlineData(false, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", null, false)]
+ [InlineData(false, 42.0, false, "Fake2806-EC0A-472D-95B7-A7132D159E03", false, null)]
[InlineData(null, null, null, null, null, null)]
public async Task LuisPredictionOptionsAreUsedInTheRequest(bool? includeAllIntents, double? timezoneOffset, bool? spellCheck, string bingSpellCheckSubscriptionKey, bool? log, bool? staging)
{
@@ -67,7 +67,7 @@ public async Task LuisPredictionOptionsAreUsedInTheRequest(bool? includeAllInten
[Theory]
[InlineData(false, null, null, null, null, null)]
- [InlineData(null, 55, null, null, null, null)]
+ [InlineData(null, 55.0, null, null, null, null)]
[InlineData(null, null, false, null, null, null)]
[InlineData(null, null, null, "Override-EC0A-472D-95B7-A7132D159E03", null, null)]
[InlineData(null, null, null, null, true, null)]
@@ -142,7 +142,7 @@ public async Task ShouldOverridePredictionOptionsIfProvided(bool? includeAllInte
[Theory]
[InlineData(false, null, null, null, null, null)]
- [InlineData(null, 55, null, null, null, null)]
+ [InlineData(null, 55.0, null, null, null, null)]
[InlineData(null, null, false, null, null, null)]
[InlineData(null, null, null, "Override-EC0A-472D-95B7-A7132D159E03", null, null)]
[InlineData(null, null, null, null, true, null)]
@@ -155,7 +155,7 @@ public async Task ShouldOverrideRecognizerOptionsIfProvided(bool? includeAllInte
var constructorOptions = new LuisPredictionOptions()
{
IncludeAllIntents = true,
- TimezoneOffset = 42,
+ TimezoneOffset = 42.0,
SpellCheck = true,
BingSpellCheckSubscriptionKey = "Fake2806-EC0A-472D-95B7-A7132D159E03",
Log = false,
diff --git a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisV3OracleTests.cs b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisV3OracleTests.cs
index 3d31cb5d44..569898d313 100644
--- a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisV3OracleTests.cs
+++ b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisV3OracleTests.cs
@@ -280,7 +280,7 @@ public void TopIntentReturnsTopIntentIfScoreEqualsMinScore()
}
[Fact]
- public void UserAgentContainsProductVersion()
+ public async Task UserAgentContainsProductVersionAsync()
{
var application = new LuisApplication
{
@@ -305,7 +305,7 @@ public void UserAgentContainsProductVersion()
var turnContext = new TurnContext(adapter, activity);
- var recognizerResult = recognizer.RecognizeAsync(turnContext, CancellationToken.None).Result;
+ var recognizerResult = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
Assert.NotNull(recognizerResult);
var userAgent = clientHandler.UserAgent;
@@ -369,7 +369,7 @@ public async Task Telemetry_OverrideOnLogAsync()
{ "test", "testvalue" },
{ "foo", "foovalue" },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties);
// Assert
Assert.NotNull(result);
@@ -416,7 +416,7 @@ public async Task Telemetry_PiiLoggedAsync()
var recognizer = new LuisRecognizer(options, clientHandler);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -464,7 +464,7 @@ public async Task Telemetry_NoPiiLoggedAsync()
var recognizer = new LuisRecognizer(options, clientHandler);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -516,7 +516,7 @@ public async Task Telemetry_OverrideOnDeriveAsync()
{ "test", "testvalue" },
{ "foo", "foovalue" },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties);
// Assert
Assert.NotNull(result);
@@ -574,7 +574,7 @@ public async Task Telemetry_OverrideFillAsync()
{ "boo", 2.11 },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics);
// Assert
Assert.NotNull(result);
@@ -627,7 +627,7 @@ public async Task Telemetry_NoOverrideAsync()
var recognizer = new LuisRecognizer(options, clientHandler);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -671,7 +671,7 @@ public async Task Telemetry_Convert()
// Act
// Use a class the converts the Recognizer Result..
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -726,7 +726,7 @@ public async Task Telemetry_ConvertParms()
{ "luis", 1.0001 },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics, CancellationToken.None);
// Assert
Assert.NotNull(result);
diff --git a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/Microsoft.Bot.Builder.AI.Luis.Tests.csproj b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/Microsoft.Bot.Builder.AI.Luis.Tests.csproj
index bd63fd7bed..4060d815a7 100644
--- a/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/Microsoft.Bot.Builder.AI.Luis.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.AI.LUIS.Tests/Microsoft.Bot.Builder.AI.Luis.Tests.csproj
@@ -19,7 +19,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests.csproj b/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests.csproj
index f68f171902..6cfd7175aa 100644
--- a/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests.csproj
@@ -14,7 +14,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/OrchestratorAdaptiveRecognizerTests.cs b/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/OrchestratorAdaptiveRecognizerTests.cs
index cdb9b11cbc..1958305618 100644
--- a/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/OrchestratorAdaptiveRecognizerTests.cs
+++ b/tests/Microsoft.Bot.Builder.AI.Orchestrator.Tests/OrchestratorAdaptiveRecognizerTests.cs
@@ -41,7 +41,7 @@ public async Task TestIntentRecognize()
var dc = new DialogContext(new DialogSet(), context, new DialogState());
var result = await recognizer.RecognizeAsync(dc, activity, default);
- Assert.Equal(1, result.Intents.Count);
+ Assert.Single(result.Intents);
Assert.True(result.Intents.ContainsKey("mockLabel"));
Assert.Equal(0.9, result.Intents["mockLabel"].Score);
}
diff --git a/tests/Microsoft.Bot.Builder.AI.QnA.Tests/LanguageServiceTests.cs b/tests/Microsoft.Bot.Builder.AI.QnA.Tests/LanguageServiceTests.cs
index 14692c0c59..6e56f4c401 100644
--- a/tests/Microsoft.Bot.Builder.AI.QnA.Tests/LanguageServiceTests.cs
+++ b/tests/Microsoft.Bot.Builder.AI.QnA.Tests/LanguageServiceTests.cs
@@ -249,10 +249,10 @@ public async Task LanguageService_TraceActivity()
await context.SendActivityAsync("echo:" + context.Activity.Text, cancellationToken: ct);
})
.Send("how do I clean the stove?")
- .AssertReply((activity) => Assert.Equal(activity.Type, ActivityTypes.Typing))
+ .AssertReply((activity) => Assert.Equal(ActivityTypes.Typing, activity.Type))
.AssertReply("echo:how do I clean the stove?")
.Send("bar")
- .AssertReply((activity) => Assert.Equal(activity.Type, ActivityTypes.Typing))
+ .AssertReply((activity) => Assert.Equal(ActivityTypes.Typing, activity.Type))
.AssertReply("echo:bar")
.StartTestAsync();
@@ -1114,10 +1114,11 @@ public void LanguageService_Test_Endpoint_EmptyKbId()
///
/// The LanguageService_Test_ScoreThresholdTooLarge_OutOfRange.
///
+ /// A representing the asynchronous unit test.
[Fact]
[Trait("TestCategory", "AI")]
[Trait("TestCategory", "LanguageService")]
- public async void LanguageService_Test_NotSpecifiedQnAServiceType()
+ public async Task LanguageService_Test_NotSpecifiedQnAServiceType()
{
AggregateException result = null;
var mockHttp = new MockHttpMessageHandler();
@@ -1771,7 +1772,7 @@ public async Task Telemetry_ReturnsAnswer()
var results = await qna.GetAnswersAsync(GetContext("how do I clean the stove?"));
// Assert - Check Telemetry logged
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("knowledgeBaseId"));
@@ -1826,7 +1827,7 @@ public async Task Telemetry_ReturnsAnswer_WhenNoAnswerFoundInKB()
var results = await qna.GetAnswersAsync(GetContext("what is the answer to my nonsense question?"));
// Assert - Check Telemetry logged
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("knowledgeBaseId"));
@@ -1999,7 +2000,7 @@ public async Task Telemetry_AdditionalPropsMetrics()
var results = await qna.GetAnswersAsync(GetContext("how do I clean the stove?"), null, telemetryProperties, telemetryMetrics);
// Assert - added properties were added.
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey(QnATelemetryConstants.KnowledgeBaseIdProperty));
@@ -2069,7 +2070,7 @@ public async Task Telemetry_AdditionalPropsOverride()
await qna.GetAnswersAsync(GetContext("how do I clean the stove?"), null, telemetryProperties, telemetryMetrics);
// Assert - added properties were added.
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("knowledgeBaseId"));
diff --git a/tests/Microsoft.Bot.Builder.AI.QnA.Tests/Microsoft.Bot.Builder.AI.QnA.Tests.csproj b/tests/Microsoft.Bot.Builder.AI.QnA.Tests/Microsoft.Bot.Builder.AI.QnA.Tests.csproj
index 2792d55300..19791d9b93 100644
--- a/tests/Microsoft.Bot.Builder.AI.QnA.Tests/Microsoft.Bot.Builder.AI.QnA.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.AI.QnA.Tests/Microsoft.Bot.Builder.AI.QnA.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.AI.QnA.Tests/QnAMakerTests.cs b/tests/Microsoft.Bot.Builder.AI.QnA.Tests/QnAMakerTests.cs
index 01e9c27c46..83e0dae39a 100644
--- a/tests/Microsoft.Bot.Builder.AI.QnA.Tests/QnAMakerTests.cs
+++ b/tests/Microsoft.Bot.Builder.AI.QnA.Tests/QnAMakerTests.cs
@@ -382,10 +382,10 @@ public async Task QnaMaker_TraceActivity()
await context.SendActivityAsync("echo:" + context.Activity.Text);
})
.Send("how do I clean the stove?")
- .AssertReply((activity) => Assert.Equal(activity.Type, ActivityTypes.Typing))
+ .AssertReply((activity) => Assert.Equal(ActivityTypes.Typing, activity.Type))
.AssertReply("echo:how do I clean the stove?")
.Send("bar")
- .AssertReply((activity) => Assert.Equal(activity.Type, ActivityTypes.Typing))
+ .AssertReply((activity) => Assert.Equal(ActivityTypes.Typing, activity.Type))
.AssertReply("echo:bar")
.StartTestAsync();
@@ -1544,7 +1544,7 @@ public async Task Telemetry_ReturnsAnswer()
var results = await qna.GetAnswersAsync(GetContext("how do I clean the stove?"));
// Assert - Check Telemetry logged
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("knowledgeBaseId"));
@@ -1598,7 +1598,7 @@ public async Task Telemetry_ReturnsAnswer_WhenNoAnswerFoundInKB()
var results = await qna.GetAnswersAsync(GetContext("what is the answer to my nonsense question?"));
// Assert - Check Telemetry logged
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("knowledgeBaseId"));
@@ -1768,7 +1768,7 @@ public async Task Telemetry_AdditionalPropsMetrics()
var results = await qna.GetAnswersAsync(GetContext("how do I clean the stove?"), null, telemetryProperties, telemetryMetrics);
// Assert - added properties were added.
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey(QnATelemetryConstants.KnowledgeBaseIdProperty));
@@ -1837,7 +1837,7 @@ public async Task Telemetry_AdditionalPropsOverride()
await qna.GetAnswersAsync(GetContext("how do I clean the stove?"), null, telemetryProperties, telemetryMetrics);
// Assert - added properties were added.
- Assert.Equal(1, telemetryClient.Invocations.Count);
+ Assert.Single(telemetryClient.Invocations);
Assert.Equal(3, telemetryClient.Invocations[0].Arguments.Count);
Assert.Equal(telemetryClient.Invocations[0].Arguments[0], QnATelemetryConstants.QnaMsgEvent);
Assert.True(((Dictionary)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("knowledgeBaseId"));
diff --git a/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/LuisV3OracleTests.cs b/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/LuisV3OracleTests.cs
index 48717bd340..52ecac7ad1 100644
--- a/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/LuisV3OracleTests.cs
+++ b/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/LuisV3OracleTests.cs
@@ -164,7 +164,7 @@ public async Task TraceActivity()
Assert.NotNull(luisTraceInfo["luisModel"]);
var recognizerResult = luisTraceInfo["recognizerResult"].ToObject();
- Assert.Equal(recognizerResult.Text, utterance);
+ Assert.Equal(utterance, recognizerResult.Text);
Assert.NotNull(recognizerResult.Intents["SpecifyName"]);
Assert.Equal(luisTraceInfo["luisResult"]["query"], utterance);
Assert.Equal(luisTraceInfo["luisModel"]["ModelID"], AppId);
@@ -268,7 +268,7 @@ public void TopIntentReturnsTopIntentIfScoreEqualsMinScore()
}
[Fact]
- public void UserAgentContainsProductVersion()
+ public async Task UserAgentContainsProductVersion()
{
var application = new LuisApplication
{
@@ -293,7 +293,7 @@ public void UserAgentContainsProductVersion()
var turnContext = new TurnContext(adapter, activity);
- var recognizerResult = recognizer.RecognizeAsync(turnContext, CancellationToken.None).Result;
+ var recognizerResult = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
Assert.NotNull(recognizerResult);
var userAgent = clientHandler.UserAgent;
@@ -358,7 +358,7 @@ public async Task Telemetry_OverrideOnLogAsync()
{ "test", "testvalue" },
{ "foo", "foovalue" },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties);
// Assert
Assert.NotNull(result);
@@ -405,7 +405,7 @@ public async Task Telemetry_PiiLoggedAsync()
var recognizer = new LuisRecognizer(luisApp, options);
// Act
- var result = await recognizer.RecognizeAsync(turnContext).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext);
// Assert
Assert.NotNull(result);
@@ -452,7 +452,7 @@ public async Task Telemetry_NoPiiLoggedAsync()
var recognizer = new LuisRecognizer(luisApp, options);
// Act
- var result = await recognizer.RecognizeAsync(turnContext).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext);
// Assert
Assert.NotNull(result);
@@ -504,7 +504,7 @@ public async Task Telemetry_OverrideOnDeriveAsync()
{ "test", "testvalue" },
{ "foo", "foovalue" },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties);
// Assert
Assert.NotNull(result);
@@ -562,7 +562,7 @@ public async Task Telemetry_OverrideFillAsync()
{ "boo", 2.11 },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics);
// Assert
Assert.NotNull(result);
@@ -615,7 +615,7 @@ public async Task Telemetry_NoOverrideAsync()
var recognizer = new LuisRecognizer(luisApp, options);
// Act
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -659,7 +659,7 @@ public async Task Telemetry_Convert()
// Act
// Use a class the converts the Recognizer Result..
- var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None);
// Assert
Assert.NotNull(result);
@@ -714,7 +714,7 @@ public async Task Telemetry_ConvertParms()
{ "luis", 1.0001 },
};
- var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics, CancellationToken.None).ConfigureAwait(false);
+ var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics, CancellationToken.None);
// Assert
Assert.NotNull(result);
diff --git a/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/Microsoft.Bot.Builder.AI.LuisV3.Tests.csproj b/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/Microsoft.Bot.Builder.AI.LuisV3.Tests.csproj
index 39d48be55a..b3bfbb6520 100644
--- a/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/Microsoft.Bot.Builder.AI.LuisV3.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Ai.LUISV3.tests/Microsoft.Bot.Builder.AI.LuisV3.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.ApplicationInsights.Tests/Microsoft.Bot.Builder.ApplicationInsights.Tests.csproj b/tests/Microsoft.Bot.Builder.ApplicationInsights.Tests/Microsoft.Bot.Builder.ApplicationInsights.Tests.csproj
index 2f6ef4bd28..b569ac711d 100644
--- a/tests/Microsoft.Bot.Builder.ApplicationInsights.Tests/Microsoft.Bot.Builder.ApplicationInsights.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.ApplicationInsights.Tests/Microsoft.Bot.Builder.ApplicationInsights.Tests.csproj
@@ -11,7 +11,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/AzureBlobStorageTests.cs b/tests/Microsoft.Bot.Builder.Azure.Tests/AzureBlobStorageTests.cs
index cc1187fb23..2265c15fbe 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/AzureBlobStorageTests.cs
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/AzureBlobStorageTests.cs
@@ -109,7 +109,7 @@ public async Task ReadAsyncOneKey()
It.IsAny(),
It.IsAny()),
Times.Once);
- Assert.Equal(1, items.Count);
+ Assert.Single(items);
Assert.True(items.ContainsKey(keys[0]));
}
@@ -138,7 +138,7 @@ public async Task ReadAsyncContinueOnNotFoundException()
It.IsAny(),
It.IsAny()),
Times.Once);
- Assert.Equal(0, items.Count);
+ Assert.Empty(items);
}
[Fact]
@@ -166,7 +166,7 @@ public async Task ReadAsyncContinueOnAggregateException()
It.IsAny(),
It.IsAny()),
Times.Once);
- Assert.Equal(0, items.Count);
+ Assert.Empty(items);
}
[Fact]
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/AzureQueueStorageTests.cs b/tests/Microsoft.Bot.Builder.Azure.Tests/AzureQueueStorageTests.cs
index 574102f191..38df1dc5e5 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/AzureQueueStorageTests.cs
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/AzureQueueStorageTests.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
+using System.Threading.Tasks;
using Azure;
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
@@ -32,7 +33,7 @@ public void ConstructorValidation()
}
[Fact]
- public async void QueueActivityAsync()
+ public async Task QueueActivityAsync()
{
var client = new Mock();
var response = new Mock>();
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsStorageTests.cs b/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsStorageTests.cs
index 219c3f1d0e..97f9bb8cd4 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsStorageTests.cs
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsStorageTests.cs
@@ -7,6 +7,7 @@
using System.Net;
using System.Text;
using System.Threading;
+using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Storage;
@@ -68,7 +69,7 @@ public void ConstructorWithTokenCredentialValidation()
}
[Fact]
- public async void WriteAsyncValidation()
+ public async Task WriteAsyncValidation()
{
InitStorage();
@@ -77,7 +78,7 @@ public async void WriteAsyncValidation()
}
[Fact]
- public async void WriteAsync()
+ public async Task WriteAsync()
{
InitStorage();
@@ -117,7 +118,7 @@ public async void WriteAsync()
}
[Fact]
- public async void WriteAsyncWithAllowedTypesSerializationBinder()
+ public async Task WriteAsyncWithAllowedTypesSerializationBinder()
{
var serializationBinder = new AllowedTypesSerializationBinder(
new List
@@ -170,7 +171,7 @@ public async void WriteAsyncWithAllowedTypesSerializationBinder()
}
[Fact]
- public async void WriteAsyncWithEmptyAllowedTypesSerializationBinder()
+ public async Task WriteAsyncWithEmptyAllowedTypesSerializationBinder()
{
var serializationBinder = new AllowedTypesSerializationBinder();
var jsonSerializerSettings = new JsonSerializerSettings
@@ -215,11 +216,11 @@ public async void WriteAsyncWithEmptyAllowedTypesSerializationBinder()
It.IsAny(),
It.IsAny()),
Times.Exactly(0));
- Assert.Equal(0, serializationBinder.AllowedTypes.Count);
+ Assert.Empty(serializationBinder.AllowedTypes);
}
[Fact]
- public async void WriteAsyncHttpBadRequestFailure()
+ public async Task WriteAsyncHttpBadRequestFailure()
{
InitStorage();
@@ -240,7 +241,7 @@ public async void WriteAsyncHttpBadRequestFailure()
}
[Fact]
- public async void DeleteAsyncValidation()
+ public async Task DeleteAsyncValidation()
{
InitStorage();
@@ -249,7 +250,7 @@ public async void DeleteAsyncValidation()
}
[Fact]
- public async void DeleteAsync()
+ public async Task DeleteAsync()
{
InitStorage();
@@ -261,7 +262,7 @@ public async void DeleteAsync()
}
[Fact]
- public async void ReadAsyncValidation()
+ public async Task ReadAsyncValidation()
{
InitStorage();
@@ -270,7 +271,7 @@ public async void ReadAsyncValidation()
}
[Fact]
- public async void ReadAsync()
+ public async Task ReadAsync()
{
InitStorage();
@@ -291,7 +292,7 @@ public async void ReadAsync()
}
[Fact]
- public async void ReadAsyncWithAllowedTypesSerializationBinder()
+ public async Task ReadAsyncWithAllowedTypesSerializationBinder()
{
var jsonSerializerSettings = new JsonSerializerSettings
{
@@ -333,7 +334,7 @@ public async void ReadAsyncWithAllowedTypesSerializationBinder()
}
[Fact]
- public async void ReadAsyncWithEmptyAllowedTypesSerializationBinder()
+ public async Task ReadAsyncWithEmptyAllowedTypesSerializationBinder()
{
var jsonSerializerSettings = new JsonSerializerSettings
{
@@ -364,7 +365,7 @@ public async void ReadAsyncWithEmptyAllowedTypesSerializationBinder()
}
[Fact]
- public async void ReadAsyncHttpPreconditionFailure()
+ public async Task ReadAsyncHttpPreconditionFailure()
{
InitStorage();
@@ -391,7 +392,7 @@ public async void ReadAsyncHttpPreconditionFailure()
}
[Fact]
- public async void ReadAsyncHttpNotFoundFailure()
+ public async Task ReadAsyncHttpNotFoundFailure()
{
InitStorage();
@@ -413,7 +414,7 @@ public async void ReadAsyncHttpNotFoundFailure()
}
[Fact]
- public async void GetBlobNameValidation()
+ public async Task GetBlobNameValidation()
{
InitStorage();
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsTranscriptStoreTests.cs b/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsTranscriptStoreTests.cs
index fe755ded97..681e2c81b7 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsTranscriptStoreTests.cs
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/BlobsTranscriptStoreTests.cs
@@ -78,7 +78,7 @@ public void ConstructorValidation()
}
[Fact]
- public async void LogActivityAsync()
+ public async Task LogActivityAsync()
{
InitStorage();
@@ -88,7 +88,7 @@ public async void LogActivityAsync()
}
[Fact]
- public async void LogActivityAsyncMessageUpdate()
+ public async Task LogActivityAsyncMessageUpdate()
{
InitStorage();
@@ -100,7 +100,7 @@ public async void LogActivityAsyncMessageUpdate()
}
[Fact]
- public async void LogActivityAsyncMessageUpdateNotFound()
+ public async Task LogActivityAsyncMessageUpdateNotFound()
{
InitStorage();
@@ -120,7 +120,7 @@ public async void LogActivityAsyncMessageUpdateNotFound()
}
[Fact]
- public async void LogActivityAsyncMessageDelete()
+ public async Task LogActivityAsyncMessageDelete()
{
InitStorage();
@@ -132,7 +132,7 @@ public async void LogActivityAsyncMessageDelete()
}
[Fact]
- public async void LogActivityAsyncContinuationToken()
+ public async Task LogActivityAsyncContinuationToken()
{
InitStorage();
@@ -160,7 +160,7 @@ public async void LogActivityAsyncContinuationToken()
}
[Fact]
- public async void LogActivityAsyncHttpPreconditionFailure()
+ public async Task LogActivityAsyncHttpPreconditionFailure()
{
InitStorage();
var precondition = true;
@@ -185,7 +185,7 @@ public async void LogActivityAsyncHttpPreconditionFailure()
}
[Fact]
- public async void GetTranscriptActivitiesAsyncValidation()
+ public async Task GetTranscriptActivitiesAsyncValidation()
{
InitStorage();
@@ -199,7 +199,7 @@ public async void GetTranscriptActivitiesAsyncValidation()
}
[Fact]
- public async void GetTranscriptActivitiesAsync()
+ public async Task GetTranscriptActivitiesAsync()
{
InitStorage();
@@ -212,7 +212,7 @@ public async void GetTranscriptActivitiesAsync()
}
[Fact]
- public async void GetTranscriptActivitiesAsyncContinuationToken()
+ public async Task GetTranscriptActivitiesAsyncContinuationToken()
{
InitStorage();
@@ -224,7 +224,7 @@ public async void GetTranscriptActivitiesAsyncContinuationToken()
}
[Fact]
- public async void GetTranscriptActivitiesAsyncFullPageSize()
+ public async Task GetTranscriptActivitiesAsyncFullPageSize()
{
const int pageSize = 20;
InitStorage(20);
@@ -238,7 +238,7 @@ public async void GetTranscriptActivitiesAsyncFullPageSize()
}
[Fact]
- public async void ListTranscriptsAsyncValidation()
+ public async Task ListTranscriptsAsyncValidation()
{
InitStorage();
@@ -248,7 +248,7 @@ public async void ListTranscriptsAsyncValidation()
}
[Fact]
- public async void ListTranscriptsAsync()
+ public async Task ListTranscriptsAsync()
{
InitStorage();
@@ -260,7 +260,7 @@ public async void ListTranscriptsAsync()
}
[Fact]
- public async void ListTranscriptsAsyncContinuationToken()
+ public async Task ListTranscriptsAsyncContinuationToken()
{
InitStorage();
@@ -272,7 +272,7 @@ public async void ListTranscriptsAsyncContinuationToken()
}
[Fact]
- public async void ListTranscriptsAsyncFullPageSize()
+ public async Task ListTranscriptsAsyncFullPageSize()
{
const int pageSize = 20;
InitStorage(pageSize);
@@ -285,7 +285,7 @@ public async void ListTranscriptsAsyncFullPageSize()
}
[Fact]
- public async void DeleteTranscriptAsyncValidation()
+ public async Task DeleteTranscriptAsyncValidation()
{
InitStorage();
@@ -299,7 +299,7 @@ public async void DeleteTranscriptAsyncValidation()
}
[Fact]
- public async void DeleteTranscriptAsync()
+ public async Task DeleteTranscriptAsync()
{
InitStorage();
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDBKeyEscapeTests.cs b/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDBKeyEscapeTests.cs
index ef0620abb1..1f5ec6f3f2 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDBKeyEscapeTests.cs
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDBKeyEscapeTests.cs
@@ -149,7 +149,7 @@ public void KeySuffix_Is_Added_To_End_of_Key()
var sanitizedKey = CosmosDbKeyEscape.EscapeKey(key, suffix, false);
// Verify the suffix was added to the end of the key
- Assert.Equal(sanitizedKey, $"{key}{suffix}");
+ Assert.Equal($"{key}{suffix}", sanitizedKey);
}
}
}
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDbPartitionedStorageTests.cs b/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDbPartitionedStorageTests.cs
index 02576e4e0a..b3a07f58d2 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDbPartitionedStorageTests.cs
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/CosmosDbPartitionedStorageTests.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Net;
using System.Threading;
+using System.Threading.Tasks;
using Microsoft.Azure.Cosmos;
using Microsoft.Bot.Builder.Dialogs;
using Moq;
@@ -103,7 +104,7 @@ public void ConstructorValidation()
}
[Fact]
- public async void ReadAsyncValidation()
+ public async Task ReadAsyncValidation()
{
InitStorage();
@@ -116,7 +117,7 @@ public async void ReadAsyncValidation()
}
[Fact]
- public async void ReadAsync()
+ public async Task ReadAsync()
{
InitStorage();
@@ -138,7 +139,7 @@ public async void ReadAsync()
}
[Fact]
- public async void ReadAsyncWithAllowedTypesSerializationBinder()
+ public async Task ReadAsyncWithAllowedTypesSerializationBinder()
{
var jsonSerializerSettings = new JsonSerializerSettings
{
@@ -176,7 +177,7 @@ public async void ReadAsyncWithAllowedTypesSerializationBinder()
}
[Fact]
- public async void ReadAsyncWithEmptyAllowedTypesSerializationBinder()
+ public async Task ReadAsyncWithEmptyAllowedTypesSerializationBinder()
{
var jsonSerializerSettings = new JsonSerializerSettings
{
@@ -208,7 +209,7 @@ public async void ReadAsyncWithEmptyAllowedTypesSerializationBinder()
}
[Fact]
- public async void ReadAsyncPartitionKey()
+ public async Task ReadAsyncPartitionKey()
{
InitStorage("/_partitionKey");
@@ -230,7 +231,7 @@ public async void ReadAsyncPartitionKey()
}
[Fact]
- public async void ReadAsyncNotFound()
+ public async Task ReadAsyncNotFound()
{
InitStorage();
@@ -244,7 +245,7 @@ public async void ReadAsyncNotFound()
}
[Fact]
- public async void ReadAsyncFailure()
+ public async Task ReadAsyncFailure()
{
InitStorage();
@@ -256,7 +257,7 @@ public async void ReadAsyncFailure()
}
[Fact]
- public async void ReadAsyncCustomPartitionKeyFailure()
+ public async Task ReadAsyncCustomPartitionKeyFailure()
{
InitStorage("/customKey");
@@ -264,7 +265,7 @@ public async void ReadAsyncCustomPartitionKeyFailure()
}
[Fact]
- public async void WriteAsyncValidation()
+ public async Task WriteAsyncValidation()
{
InitStorage();
@@ -276,7 +277,7 @@ public async void WriteAsyncValidation()
}
[Fact]
- public async void WriteAsync()
+ public async Task WriteAsync()
{
InitStorage();
@@ -295,7 +296,7 @@ public async void WriteAsync()
}
[Fact]
- public async void WriteAsyncWithAllowedTypesSerializationBinder()
+ public async Task WriteAsyncWithAllowedTypesSerializationBinder()
{
var serializationBinder = new AllowedTypesSerializationBinder(
new List
@@ -332,7 +333,7 @@ public async void WriteAsyncWithAllowedTypesSerializationBinder()
}
[Fact]
- public async void WriteAsyncWithEmptyAllowedTypesSerializationBinder()
+ public async Task WriteAsyncWithEmptyAllowedTypesSerializationBinder()
{
var serializationBinder = new AllowedTypesSerializationBinder();
var jsonSerializerSettings = new JsonSerializerSettings
@@ -360,11 +361,11 @@ public async void WriteAsyncWithEmptyAllowedTypesSerializationBinder()
await Assert.ThrowsAsync(() => _storage.WriteAsync(changes));
_container.Verify(e => e.UpsertItemAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(0));
- Assert.Equal(0, serializationBinder.AllowedTypes.Count);
+ Assert.Empty(serializationBinder.AllowedTypes);
}
[Fact]
- public async void WriteAsyncEmptyTagFailure()
+ public async Task WriteAsyncEmptyTagFailure()
{
InitStorage();
@@ -377,7 +378,7 @@ public async void WriteAsyncEmptyTagFailure()
}
[Fact]
- public async void WriteAsyncFailure()
+ public async Task WriteAsyncFailure()
{
InitStorage();
@@ -391,7 +392,7 @@ public async void WriteAsyncFailure()
}
[Fact]
- public async void WriteAsyncWithNestedFailure()
+ public async Task WriteAsyncWithNestedFailure()
{
InitStorage();
@@ -405,7 +406,7 @@ public async void WriteAsyncWithNestedFailure()
}
[Fact]
- public async void WriteAsyncWithNestedDialogFailure()
+ public async Task WriteAsyncWithNestedDialogFailure()
{
InitStorage();
@@ -423,7 +424,7 @@ public async void WriteAsyncWithNestedDialogFailure()
}
[Fact]
- public async void DeleteAsyncValidation()
+ public async Task DeleteAsyncValidation()
{
InitStorage();
@@ -432,7 +433,7 @@ public async void DeleteAsyncValidation()
}
[Fact]
- public async void DeleteAsync()
+ public async Task DeleteAsync()
{
InitStorage();
@@ -444,7 +445,7 @@ public async void DeleteAsync()
}
[Fact]
- public async void DeleteAsyncNotFound()
+ public async Task DeleteAsyncNotFound()
{
InitStorage();
@@ -457,7 +458,7 @@ public async void DeleteAsyncNotFound()
}
[Fact]
- public async void DeleteAsyncFailure()
+ public async Task DeleteAsyncFailure()
{
InitStorage();
diff --git a/tests/Microsoft.Bot.Builder.Azure.Tests/Microsoft.Bot.Builder.Azure.Tests.csproj b/tests/Microsoft.Bot.Builder.Azure.Tests/Microsoft.Bot.Builder.Azure.Tests.csproj
index b0c39a4474..06556607a8 100644
--- a/tests/Microsoft.Bot.Builder.Azure.Tests/Microsoft.Bot.Builder.Azure.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Azure.Tests/Microsoft.Bot.Builder.Azure.Tests.csproj
@@ -10,7 +10,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Assertions.cs b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Assertions.cs
index 1e30a9f6d5..dbbdf308db 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Assertions.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Assertions.cs
@@ -100,7 +100,7 @@ public static ServiceDescriptor AssertServiceDescriptor(
IList descriptors = searchOptions.Search(services).ToList();
- Assert.Equal(expected: 1, actual: descriptors.Count);
+ Assert.Single(descriptors);
ServiceDescriptor descriptor = descriptors[0];
Assert.Equal(expected: lifetime, actual: descriptor.Lifetime);
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests.csproj b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests.csproj
index a61f05b810..7a77df53c4 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/ActivityFactoryTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/ActivityFactoryTests.cs
index fb1d2dfac1..02439733ac 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/ActivityFactoryTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/ActivityFactoryTests.cs
@@ -58,7 +58,7 @@ public void TestNotSupportStructuredType()
// fallback to text activity
var lgResult = templates.Evaluate("notSupport");
var activity = ActivityFactory.FromObject(lgResult);
- Assert.Equal(0, activity.Attachments.Count);
+ Assert.Empty(activity.Attachments);
Assert.Equal("{\"lgType\":\"Acti\",\"key\":\"value\"}", activity.Text.Replace("\r\n", string.Empty).Replace("\n", string.Empty).Replace(" ", string.Empty));
}
@@ -410,11 +410,11 @@ private void AssertMessageActivityAll(Activity activity)
Assert.Equal("accepting", activity.InputHint);
var semanticAction = activity.SemanticAction;
Assert.Equal("actionId", semanticAction.Id);
- Assert.Equal(1, semanticAction.Entities.Count);
+ Assert.Single(semanticAction.Entities);
Assert.True(semanticAction.Entities.ContainsKey("key1"));
Assert.Equal("entityType", semanticAction.Entities["key1"].Type);
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(AttachmentLayoutTypes.List, activity.AttachmentLayout);
Assert.Equal(HeroCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
@@ -424,7 +424,7 @@ private void AssertMessageActivityAll(Activity activity)
Assert.Equal("tapvalue", tap.Value);
Assert.Equal("imBack", tap.Type);
Assert.Equal("textContent", card.Text);
- Assert.Equal(1, card.Buttons.Count);
+ Assert.Single(card.Buttons);
Assert.Equal($"imBack", card.Buttons[0].Type);
Assert.Equal($"titleContent", card.Buttons[0].Title);
Assert.Equal($"textContent", card.Buttons[0].Value);
@@ -472,7 +472,7 @@ private void AssertActivityWithHeroCardAttachment(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(HeroCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
var tap = card.Tap;
@@ -482,7 +482,7 @@ private void AssertActivityWithHeroCardAttachment(Activity activity)
Assert.NotNull(card);
Assert.Equal("titleContent", card.Title);
Assert.Equal("textContent", card.Text);
- Assert.Equal(1, card.Buttons.Count);
+ Assert.Single(card.Buttons);
Assert.Equal($"imBack", card.Buttons[0].Type);
Assert.Equal($"titleContent", card.Buttons[0].Title);
Assert.Equal($"textContent", card.Buttons[0].Value);
@@ -513,7 +513,7 @@ private void AssertAdaptiveCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal("application/vnd.microsoft.card.adaptive", activity.Attachments[0].ContentType);
Assert.Equal("test", (string)((dynamic)activity.Attachments[0].Content).body[0].text);
}
@@ -536,13 +536,13 @@ private void AssertCardActionActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(HeroCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
Assert.Equal("titleContent", card.Title);
Assert.Equal("textContent", card.Text);
- Assert.Equal(1, card.Buttons.Count);
+ Assert.Single(card.Buttons);
Assert.Equal($"imBack", card.Buttons[0].Type);
Assert.Equal($"titleContent", card.Buttons[0].Title);
Assert.Equal($"textContent", card.Buttons[0].Value);
@@ -553,7 +553,7 @@ private void AssertThumbnailCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(ThumbnailCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
@@ -574,7 +574,7 @@ private void AssertHeroCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(HeroCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
@@ -595,7 +595,7 @@ private void AssertCustomizedCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal("cardaction", activity.Attachments[0].ContentType);
var cardContent = (JObject)activity.Attachments[0].Content;
Assert.NotNull(cardContent);
@@ -610,7 +610,7 @@ private void AssertAudioCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(AudioCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
@@ -635,7 +635,7 @@ private void AssertVideoCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(VideoCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
@@ -660,12 +660,12 @@ private void AssertSigninCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(SigninCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
Assert.Equal("This is some text describing the card, it's cool because it's cool", card.Text);
- Assert.Equal(1, card.Buttons.Count);
+ Assert.Single(card.Buttons);
Assert.Equal($"Sign in", card.Buttons[0].Title);
Assert.Equal(ActionTypes.Signin, card.Buttons[0].Type);
Assert.Equal($"https://login.microsoftonline.com/", card.Buttons[0].Value);
@@ -676,13 +676,13 @@ private void AssertOAuthCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(OAuthCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
Assert.Equal("This is some text describing the card, it's cool because it's cool", card.Text);
Assert.Equal("MyConnection", card.ConnectionName);
- Assert.Equal(1, card.Buttons.Count);
+ Assert.Single(card.Buttons);
Assert.Equal($"Sign in", card.Buttons[0].Title);
Assert.Equal(ActionTypes.Signin, card.Buttons[0].Type);
Assert.Equal($"https://login.microsoftonline.com/", card.Buttons[0].Value);
@@ -693,7 +693,7 @@ private void AssertAnimationCardActivity(Activity activity)
Assert.Equal(ActivityTypes.Message, activity.Type);
Assert.True(string.IsNullOrEmpty(activity.Text));
Assert.True(string.IsNullOrEmpty(activity.Speak));
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(AnimationCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
@@ -737,7 +737,7 @@ private void AssertActivityWithMultiStringSuggestionActions(Activity activity)
private void AssertReceiptCardActivity(Activity activity)
{
Assert.Equal(ActivityTypes.Message, activity.Type);
- Assert.Equal(1, activity.Attachments.Count);
+ Assert.Single(activity.Attachments);
Assert.Equal(ReceiptCard.ContentType, activity.Attachments[0].ContentType);
var card = ((JObject)activity.Attachments[0].Content).ToObject();
Assert.NotNull(card);
@@ -746,7 +746,7 @@ private void AssertReceiptCardActivity(Activity activity)
Assert.Equal("$ 90.95", card.Total);
var buttons = card.Buttons;
- Assert.Equal(1, buttons.Count);
+ Assert.Single(buttons);
Assert.Equal(ActionTypes.OpenUrl, buttons[0].Type);
Assert.Equal("More information", buttons[0].Title);
Assert.Equal("https://account.windowsazure.com/content/6.10.1.38-.8225.160809-1618/aux-pre/images/offer-icon-freetrial.png", buttons[0].Image);
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests.csproj b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests.csproj
index 04d7684779..2d956ad11b 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests.csproj
@@ -21,7 +21,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/ChoiceOptionsSetTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/ChoiceOptionsSetTests.cs
index e74868f6cd..9e82cffde5 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/ChoiceOptionsSetTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/ChoiceOptionsSetTests.cs
@@ -34,7 +34,7 @@ public async Task BindAsyncNullTemplate()
var context = new TurnContext(new TestAdapter(), _activity);
var dc = new DialogContext(new DialogSet(), context, new DialogState());
- var choiceFactory = await choiceOptions.BindAsync(dc).ConfigureAwait(false);
+ var choiceFactory = await choiceOptions.BindAsync(dc);
Assert.Equal(choiceOptions, choiceFactory);
}
@@ -46,7 +46,7 @@ public async Task BindAsyncNullLanguageGenerator()
var context = new TurnContext(new TestAdapter(), _activity);
var dc = new DialogContext(new DialogSet(), context, new DialogState());
- await Assert.ThrowsAsync(async () => await choiceOptions.BindAsync(dc).ConfigureAwait(false));
+ await Assert.ThrowsAsync(async () => await choiceOptions.BindAsync(dc));
}
[Fact]
@@ -62,7 +62,7 @@ public async Task BindAsyncReturnsLGResult()
var dc = new DialogContext(new DialogSet(), context, new DialogState());
dc.Services.Add(mockLG.Object);
- var choiceFactory = await choiceOptions.BindAsync(dc).ConfigureAwait(false);
+ var choiceFactory = await choiceOptions.BindAsync(dc);
Assert.Equal(lgResult, choiceFactory);
}
@@ -80,7 +80,7 @@ public async Task BindAsyncReturnsChoiceFactoryOptions()
var dc = new DialogContext(new DialogSet(), context, new DialogState());
dc.Services.Add(mockLG.Object);
- var choiceFactory = await choiceOptions.BindAsync(dc).ConfigureAwait(false);
+ var choiceFactory = await choiceOptions.BindAsync(dc);
Assert.Equal(",", choiceFactory.InlineSeparator);
Assert.Equal(", or", choiceFactory.InlineOrMore);
@@ -101,7 +101,7 @@ public async Task BindAsyncThrowsArgumentOutOfRangeException()
var dc = new DialogContext(new DialogSet(), context, new DialogState());
dc.Services.Add(mockLG.Object);
- Assert.Null(await choiceOptions.BindAsync(dc).ConfigureAwait(false));
+ Assert.Null(await choiceOptions.BindAsync(dc));
}
[Fact]
@@ -117,7 +117,7 @@ public async Task BindAsyncThrowsJsonReaderException()
var dc = new DialogContext(new DialogSet(), context, new DialogState());
dc.Services.Add(mockLG.Object);
- Assert.Null(await choiceOptions.BindAsync(dc).ConfigureAwait(false));
+ Assert.Null(await choiceOptions.BindAsync(dc));
}
[Fact]
@@ -132,7 +132,7 @@ public async Task BindAsyncReturnsNull()
var dc = new DialogContext(new DialogSet(), context, new DialogState());
dc.Services.Add(mockLG.Object);
- Assert.Null(await choiceOptions.BindAsync(dc).ConfigureAwait(false));
+ Assert.Null(await choiceOptions.BindAsync(dc));
}
}
}
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/DebugComposer.cs b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/DebugComposer.cs
index 2096e483b2..6124a4dea6 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/DebugComposer.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/DebugComposer.cs
@@ -47,7 +47,7 @@ public async Task DebugComposerBot()
var script = resourceExplorer.LoadType(testScript);
script.Locale = locale;
script.Configuration = builder.Build();
- await script.ExecuteAsync(resourceExplorer: resourceExplorer).ConfigureAwait(false);
+ await script.ExecuteAsync(resourceExplorer: resourceExplorer);
}
}
}
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerRecognizerTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerRecognizerTests.cs
index 1a56ffbba5..b31b341227 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerRecognizerTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerRecognizerTests.cs
@@ -51,12 +51,19 @@ public class EntityRecognizerRecognizerTests
});
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestAge()
+After:
+ public void TestAgeAsync()
+*/
+ public async Task TestAgeAsync()
{
- var dialogContext = GetDialogContext(nameof(TestAge), "This is a test of one, 2, three years old");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestAgeAsync), "This is a test of one, 2, three years old");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -67,12 +74,19 @@ public void TestAge()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestConfirmation()
+After:
+ public void TestConfirmationAsync()
+*/
+ public async Task TestConfirmationAsync()
{
- var dialogContext = GetDialogContext(nameof(TestConfirmation), "yes, please");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestConfirmationAsync), "yes, please");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -82,12 +96,19 @@ public void TestConfirmation()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestCurrency()
+After:
+ public void TestCurrencyAsync()
+*/
+ public async Task TestCurrencyAsync()
{
- var dialogContext = GetDialogContext(nameof(TestCurrency), "I would pay four dollars for that.");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestCurrencyAsync), "I would pay four dollars for that.");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -97,12 +118,19 @@ public void TestCurrency()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestDateTime()
+After:
+ public void TestDateTimeAsync()
+*/
+ public async Task TestDateTimeAsync()
{
- var dialogContext = GetDialogContext(nameof(TestDateTime), "Next thursday at 4pm.");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestDateTimeAsync), "Next thursday at 4pm.");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -113,12 +141,19 @@ public void TestDateTime()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestDimension()
+After:
+ public void TestDimensionAsync()
+*/
+ public async Task TestDimensionAsync()
{
- var dialogContext = GetDialogContext(nameof(TestDimension), "I think he's 5 foot ten");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestDimensionAsync), "I think he's 5 foot ten");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -128,12 +163,19 @@ public void TestDimension()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestEmail()
+After:
+ public void TestEmailAsync()
+*/
+ public async Task TestEmailAsync()
{
- var dialogContext = GetDialogContext(nameof(TestEmail), "my email address is foo@att.uk.co");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestEmailAsync), "my email address is foo@att.uk.co");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -142,13 +184,20 @@ public void TestEmail()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestGuid()
+After:
+ public void TestGuidAsync()
+*/
+ public async Task TestGuidAsync()
{
var guid = Guid.Empty;
- var dialogContext = GetDialogContext(nameof(TestGuid), $"my account number is {guid}...");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestGuidAsync), $"my account number is {guid}...");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -157,12 +206,19 @@ public void TestGuid()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestHashtag()
+After:
+ public void TestHashtagAsync()
+*/
+ public async Task TestHashtagAsync()
{
- var dialogContext = GetDialogContext(nameof(TestHashtag), $"I'm so cool #cool #groovy...");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestHashtagAsync), $"I'm so cool #cool #groovy...");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -171,12 +227,19 @@ public void TestHashtag()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestIp()
+After:
+ public void TestIpAsync()
+*/
+ public async Task TestIpAsync()
{
- var dialogContext = GetDialogContext(nameof(TestIp), $"My address is 1.2.3.4");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestIpAsync), $"My address is 1.2.3.4");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -186,12 +249,19 @@ public void TestIp()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestMention()
+After:
+ public void TestMentionAsync()
+*/
+ public async Task TestMentionAsync()
{
- var dialogContext = GetDialogContext(nameof(TestMention), $"Tell @joesmith I'm coming...");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestMentionAsync), $"Tell @joesmith I'm coming...");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -206,9 +276,9 @@ public void TestMention()
}
[Fact]
- public void TestChannelMentionEntityRecognizer()
+ public async Task TestChannelMentionEntityRecognizerAsync()
{
- var dialogContext = GetDialogContext(nameof(TestMention), $"joelee bobsm...");
+ var dialogContext = GetDialogContext(nameof(TestMentionAsync), $"joelee bobsm...");
dialogContext.Context.Activity.Entities = new List();
dynamic mention = new JObject();
@@ -227,9 +297,9 @@ public void TestChannelMentionEntityRecognizer()
mention.text = "bobsm";
dialogContext.Context.Activity.Entities.Add(((JObject)mention).ToObject());
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -273,16 +343,23 @@ public async Task TelemetryDoesNotLogByDefault()
Assert.NotNull(result);
Assert.Empty(result.Intents);
Assert.Empty(result.Entities);
- Assert.Equal(0, telemetryClient.Invocations.Count);
+ Assert.Empty(telemetryClient.Invocations);
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestNumber()
+After:
+ public void TestNumberAsync()
+*/
+ public async Task TestNumberAsync()
{
- var dialogContext = GetDialogContext(nameof(TestNumber), "This is a test of one, 2, three");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestNumberAsync), "This is a test of one, 2, three");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -291,12 +368,19 @@ public void TestNumber()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestNumberRange()
+After:
+ public void TestNumberRangeAsync()
+*/
+ public async Task TestNumberRangeAsync()
{
- var dialogContext = GetDialogContext(nameof(TestNumberRange), "there are 3 to 5 of them");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestNumberRangeAsync), "there are 3 to 5 of them");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -305,12 +389,19 @@ public void TestNumberRange()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestOrdinal()
+After:
+ public void TestOrdinalAsync()
+*/
+ public async Task TestOrdinalAsync()
{
- var dialogContext = GetDialogContext(nameof(TestOrdinal), "First, second or third");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestOrdinalAsync), "First, second or third");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -319,12 +410,19 @@ public void TestOrdinal()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestPercentage()
+After:
+ public void TestPercentageAsync()
+*/
+ public async Task TestPercentageAsync()
{
- var dialogContext = GetDialogContext(nameof(TestPercentage), "The population hit 33.3%");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestPercentageAsync), "The population hit 33.3%");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -333,12 +431,19 @@ public void TestPercentage()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestPhoneNumber()
+After:
+ public void TestPhoneNumberAsync()
+*/
+ public async Task TestPhoneNumberAsync()
{
- var dialogContext = GetDialogContext(nameof(TestPhoneNumber), "Call 425-882-8080");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestPhoneNumberAsync), "Call 425-882-8080");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -347,12 +452,19 @@ public void TestPhoneNumber()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestTemperature()
+After:
+ public void TestTemperatureAsync()
+*/
+ public async Task TestTemperatureAsync()
{
- var dialogContext = GetDialogContext(nameof(TestTemperature), "set the oven to 350 degrees");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestTemperatureAsync), "set the oven to 350 degrees");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -361,12 +473,19 @@ public void TestTemperature()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestUrl()
+After:
+ public void TestUrlAsync()
+*/
+ public async Task TestUrlAsync()
{
- var dialogContext = GetDialogContext(nameof(TestUrl), "go to http://about.me for more info");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestUrlAsync), "go to http://about.me for more info");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -375,13 +494,20 @@ public void TestUrl()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestRegEx()
+After:
+ public void TestRegExAsync()
+*/
+ public async Task TestRegExAsync()
{
// I would like {order}
- var dialogContext = GetDialogContext(nameof(TestRegEx), "I would like a red or Blue cat");
- var results = recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity).Result;
+ var dialogContext = GetDialogContext(nameof(TestRegExAsync), "I would like a red or Blue cat");
+ var results = await recognizers.Value.RecognizeAsync(dialogContext, dialogContext.Context.Activity);
- Assert.Equal(1, results.Intents.Count);
+ Assert.Single(results.Intents);
Assert.Equal("None", results.Intents.Single().Key);
dynamic entities = results.Entities;
@@ -410,7 +536,7 @@ public async Task TestTelemetryDoesNotLogByDefault()
Assert.NotNull(result);
Assert.Empty(result.Intents);
Assert.Empty(result.Entities);
- Assert.Equal(0, telemetryClient.Invocations.Count);
+ Assert.Empty(telemetryClient.Invocations);
}
private DialogContext GetDialogContext(string testName, string text, string locale = "en-us")
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerTests.cs
index 34434c8acd..59a4e6d2d7 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/EntityRecognizerTests.cs
@@ -3,6 +3,7 @@
using System;
using System.Linq;
+using System.Threading.Tasks;
using Microsoft.Bot.Builder.Adapters;
using Newtonsoft.Json;
using Xunit;
@@ -41,40 +42,61 @@ public class EntityRecognizerTests
});
[Fact]
- public void TestAge()
+ public async Task TestAgeAsync()
{
- var turnContext = GetTurnContext(nameof(TestAge), "This is a test of one, 2, three years old");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestAgeAsync), "This is a test of one, 2, three years old");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(6, results.Count);
Assert.Single(results.Where(entity => entity.Type == "age").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestConfirmation()
+After:
+ public void TestConfirmationAsync()
+*/
+ public async Task TestConfirmationAsync()
{
- var turnContext = GetTurnContext(nameof(TestConfirmation), "yes, please");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestConfirmationAsync), "yes, please");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(2, results.Count);
Assert.Single(results.Where(entity => entity.Type == "boolean").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestCurrency()
+After:
+ public void TestCurrencyAsync()
+*/
+ public async Task TestCurrencyAsync()
{
- var turnContext = GetTurnContext(nameof(TestCurrency), "I would pay four dollars for that.");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestCurrencyAsync), "I would pay four dollars for that.");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(3, results.Count);
Assert.Single(results.Where(entity => entity.Type == "currency").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestDateTime()
+After:
+ public void TestDateTimeAsync()
+*/
+ public async Task TestDateTimeAsync()
{
- var turnContext = GetTurnContext(nameof(TestDateTime), "Next thursday at 4pm.");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestDateTimeAsync), "Next thursday at 4pm.");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(4, results.Count);
Assert.Single(results.Where(entity => entity.Type == "datetimeV2.datetime").ToList());
@@ -83,142 +105,240 @@ public void TestDateTime()
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestDimension()
+After:
+ public void TestDimensionAsync()
+*/
+ public async Task TestDimensionAsync()
{
- var turnContext = GetTurnContext(nameof(TestDimension), "I think he's 5 foot ten");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestDimensionAsync), "I think he's 5 foot ten");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(4, results.Count);
Assert.Single(results.Where(entity => entity.Type == "dimension").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestEmail()
+After:
+ public void TestEmailAsync()
+*/
+ public async Task TestEmailAsync()
{
- var turnContext = GetTurnContext(nameof(TestEmail), "my email address is foo@att.uk.co");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestEmailAsync), "my email address is foo@att.uk.co");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(2, results.Count);
Assert.Single(results.Where(entity => entity.Type == "email").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestGuid()
+After:
+ public void TestGuidAsync()
+*/
+ public async Task TestGuidAsync()
{
var guid = Guid.Empty;
- var turnContext = GetTurnContext(nameof(TestGuid), $"my account number is {guid}...");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestGuidAsync), $"my account number is {guid}...");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(7, results.Count);
Assert.Single(results.Where(entity => entity.Type == "guid").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestHashtag()
+After:
+ public void TestHashtagAsync()
+*/
+ public async Task TestHashtagAsync()
{
- var turnContext = GetTurnContext(nameof(TestHashtag), $"I'm so cool #cool #groovy...");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestHashtagAsync), $"I'm so cool #cool #groovy...");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(3, results.Count);
Assert.Equal(2, results.Where(entity => entity.Type == "hashtag").Count());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestIp()
+After:
+ public void TestIpAsync()
+*/
+ public async Task TestIpAsync()
{
- var turnContext = GetTurnContext(nameof(TestIp), $"My address is 1.2.3.4");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestIpAsync), $"My address is 1.2.3.4");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(6, results.Count);
Assert.Single(results.Where(entity => entity.Type == "ip").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestMention()
+After:
+ public void TestMentionAsync()
+*/
+ public async Task TestMentionAsync()
{
- var turnContext = GetTurnContext(nameof(TestMention), $"Tell @joesmith I'm coming...");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestMentionAsync), $"Tell @joesmith I'm coming...");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(2, results.Count);
Assert.Single(results.Where(entity => entity.Type == "mention").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestNumber()
+After:
+ public void TestNumberAsync()
+*/
+ public async Task TestNumberAsync()
{
- var turnContext = GetTurnContext(nameof(TestNumber), "This is a test of one, 2, three");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestNumberAsync), "This is a test of one, 2, three");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(4, results.Count);
Assert.Equal(3, results.Where(entity => entity.Type == "number").Count());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestNumberRange()
+After:
+ public void TestNumberRangeAsync()
+*/
+ public async Task TestNumberRangeAsync()
{
- var turnContext = GetTurnContext(nameof(TestNumberRange), "there are 3 to 5 of them");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestNumberRangeAsync), "there are 3 to 5 of them");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(4, results.Count);
Assert.Single(results.Where(entity => entity.Type == "numberrange").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestOrdinal()
+After:
+ public void TestOrdinalAsync()
+*/
+ public async Task TestOrdinalAsync()
{
- var turnContext = GetTurnContext(nameof(TestOrdinal), "First, second or third");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestOrdinalAsync), "First, second or third");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(4, results.Count);
Assert.Equal(3, results.Where(entity => entity.Type == "ordinal").Count());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestPercentage()
+After:
+ public void TestPercentageAsync()
+*/
+ public async Task TestPercentageAsync()
{
- var turnContext = GetTurnContext(nameof(TestPercentage), "The population hit 33.3%");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestPercentageAsync), "The population hit 33.3%");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(3, results.Count);
Assert.Single(results.Where(entity => entity.Type == "percentage").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestPhoneNumber()
+After:
+ public void TestPhoneNumberAsync()
+*/
+ public async Task TestPhoneNumberAsync()
{
- var turnContext = GetTurnContext(nameof(TestPhoneNumber), "Call 425-882-8080");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestPhoneNumberAsync), "Call 425-882-8080");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(5, results.Count);
Assert.Single(results.Where(entity => entity.Type == "phonenumber").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestTemperature()
+After:
+ public void TestTemperatureAsync()
+*/
+ public async Task TestTemperatureAsync()
{
- var turnContext = GetTurnContext(nameof(TestTemperature), "set the oven to 350 degrees");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestTemperatureAsync), "set the oven to 350 degrees");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(3, results.Count);
Assert.Single(results.Where(entity => entity.Type == "temperature").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestUrl()
+After:
+ public void TestUrlAsync()
+*/
+ public async Task TestUrlAsync()
{
- var turnContext = GetTurnContext(nameof(TestUrl), "go to http://about.me for more info");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestUrlAsync), "go to http://about.me for more info");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(2, results.Count);
Assert.Single(results.Where(entity => entity.Type == "url").ToList());
}
[Fact]
+
+/* Unmerged change from project 'Microsoft.Bot.Builder.Dialogs.Adaptive.Tests (net8.0)'
+Before:
public void TestRegEx()
+After:
+ public void TestRegExAsync()
+*/
+ public async Task TestRegExAsync()
{
// I would like {order}
- var turnContext = GetTurnContext(nameof(TestRegEx), "I would like a red or Blue cat");
- var results = recognizers.Value.RecognizeEntitiesAsync(turnContext).Result;
+ var turnContext = GetTurnContext(nameof(TestRegExAsync), "I would like a red or Blue cat");
+ var results = await recognizers.Value.RecognizeEntitiesAsync(turnContext);
Assert.Equal(3, results.Count);
Assert.Equal(2, results.Where(entity => entity.Type == "color").Count());
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests.csproj b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests.csproj
index 8b1fae76ce..363bc295d6 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests/Microsoft.Bot.Builder.Dialogs.Adaptive.Tests.csproj
@@ -36,7 +36,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/DebuggerSourceMapTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/DebuggerSourceMapTests.cs
index 852d1f9672..d176d3b0cd 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/DebuggerSourceMapTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/DebuggerSourceMapTests.cs
@@ -253,7 +253,7 @@ public void DebuggerSourceMap_SetBreakpoints_Function()
};
var breakpoints = sourceMap.SetBreakpoints(breakpointList);
- Assert.Equal(1, breakpoints.Count);
+ Assert.Single(breakpoints);
}
}
}
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests.csproj b/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests.csproj
index bf1135fb03..3bbda4bf32 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests.csproj
@@ -12,7 +12,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/TraceTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/TraceTests.cs
index ac58224324..0a73b3b20d 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/TraceTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Debugging.Tests/TraceTests.cs
@@ -63,7 +63,7 @@ WaterfallStep MakeStep(string text, DialogTurnResult result = null)
await new TestFlow((TestAdapter)adapter, async (turnContext, cancellationToken) =>
{
- await dialogManager.OnTurnAsync(turnContext, cancellationToken).ConfigureAwait(false);
+ await dialogManager.OnTurnAsync(turnContext, cancellationToken);
})
.Send("one")
.AssertReply("hello")
@@ -95,7 +95,7 @@ let score
});
var tokens = sorted.Select(JToken.FromObject).Select(TraceOracle.Normalize).ToArray();
- await TraceOracle.ValidateAsync(pathJson, tokens, _output).ConfigureAwait(false);
+ await TraceOracle.ValidateAsync(pathJson, tokens, _output);
}
internal static DialogDebugAdapter MakeDebugger(IDebugTransport transport)
@@ -129,7 +129,7 @@ public MockTransport(List trace)
async Task IDebugTransport.ReadAsync(CancellationToken cancellationToken)
{
- await _count.WaitAsync(cancellationToken).ConfigureAwait(false);
+ await _count.WaitAsync(cancellationToken);
lock (_gate)
{
return _queue.Dequeue();
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests.csproj b/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests.csproj
index 62716eb9fd..402be4216b 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests.csproj
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests.csproj
@@ -13,7 +13,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/ResourceTests.cs b/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/ResourceTests.cs
index 089d44934a..4669ef3e55 100644
--- a/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/ResourceTests.cs
+++ b/tests/Microsoft.Bot.Builder.Dialogs.Declarative.Tests/ResourceTests.cs
@@ -176,7 +176,7 @@ public async Task TestFolderSource_NewFiresChanged()
// new file
File.WriteAllText(testDialogFile, "{}");
- await Task.WhenAny(changeFired.Task, Task.Delay(5000)).ConfigureAwait(false);
+ await Task.WhenAny(changeFired.Task, Task.Delay(5000));
AssertResourceFound(explorer, testId);
}
@@ -215,7 +215,7 @@ public async Task TestFolderSource_WriteFiresChanged()
contents = "{'foo':123 }";
File.WriteAllText(testDialogFile, contents);
- await Task.WhenAny(changeFired.Task, Task.Delay(5000)).ConfigureAwait(false);
+ await Task.WhenAny(changeFired.Task, Task.Delay(5000));
AssertResourceFound(explorer, testId);
@@ -252,7 +252,7 @@ public async Task TestFolderSource_DeleteFiresChanged()
// changed file
File.Delete(testDialogFile);
- await Task.WhenAny(changeFired.Task, Task.Delay(5000)).ConfigureAwait(false);
+ await Task.WhenAny(changeFired.Task, Task.Delay(5000));
AssertResourceNull(explorer, testId);
}
@@ -274,7 +274,7 @@ public async Task ResourceExplorer_ReadTokenRange_AssignId()
var resource = explorer.GetResource(resourceId);
// Read token range using resource explorer
- var (jToken, range) = await explorer.ReadTokenRangeAsync(resource, sourceContext).ConfigureAwait(false);
+ var (jToken, range) = await explorer.ReadTokenRangeAsync(resource, sourceContext);
// Verify correct range
var expectedRange = new SourceRange
@@ -307,7 +307,7 @@ public async Task ResourceExplorer_ReadTokenRangeAdvance_AssignId()
var resource = explorer.GetResource(resourceId);
// Read token range using resource explorer
- var (jToken, range) = await explorer.ReadTokenRangeAsync(resource, sourceContext, true).ConfigureAwait(false);
+ var (jToken, range) = await explorer.ReadTokenRangeAsync(resource, sourceContext, true);
// Verify correct range
var expectedRange = new SourceRange
@@ -339,7 +339,7 @@ public async Task ResourceExplorer_LoadType_VerifyTokenRangeAndIdAssigned()
// Load file using resource explorer
var resource = explorer.GetResource(resourceId);
- var dialog = await explorer.LoadTypeAsync