diff --git a/.eslintrc.json b/.eslintrc.json
index d21952753f..5bcc487e97 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -8,6 +8,7 @@
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
- }
+ },
+ "root": true
}
diff --git a/.gitignore b/.gitignore
index 7f2ab38b1a..1635c14d55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -384,6 +384,9 @@ experimental/generator-dotnet-yeoman/node_modules
# Allow the root-level /packages/ directory or it gets confused with NuGet directories
!/[Pp]ackages/*
+# Allow the packages directory under tests
+!/tests/unit/[Pp]ackages/*
+
# Ignore correct yarn files (no zero install support)
.yarn/*
!.yarn/patches
diff --git a/build/yaml/templates/component-template.yml b/build/yaml/templates/component-template.yml
index bd27ea611e..935cd64a04 100644
--- a/build/yaml/templates/component-template.yml
+++ b/build/yaml/templates/component-template.yml
@@ -31,7 +31,6 @@ stages:
- job: build_test_dotnet
displayName: Build and test .csproj with dotnet
steps:
- - template: dotnet-install-sdk-steps.yml
- template: dotnet-build-test-steps.yml
- stage: stage_package_nuget
@@ -44,7 +43,6 @@ stages:
condition: eq(variables.ComponentType, 'codeExtension')
steps:
- template: nuget-versioning-steps.yml
- - template: dotnet-install-sdk-steps.yml
- template: dotnet-package-steps.yml
- template: nuget-signing-steps.yml
- job: job_pack_nuspec
diff --git a/build/yaml/templates/dotnet-build-test-steps.yml b/build/yaml/templates/dotnet-build-test-steps.yml
index cf6901e5b2..6a6c0e7bc5 100644
--- a/build/yaml/templates/dotnet-build-test-steps.yml
+++ b/build/yaml/templates/dotnet-build-test-steps.yml
@@ -1,4 +1,14 @@
steps:
+- task: UseDotNet@2
+ displayName: 'Use .Net Core sdk 2.1.x'
+ inputs:
+ version: 2.1.x
+
+- task: UseDotNet@2
+ displayName: 'Use .Net Core sdk 3.1.x'
+ inputs:
+ version: 3.1.x
+
- task: DotNetCoreCLI@2
displayName: 'Run `dotnet restore`'
inputs:
diff --git a/build/yaml/templates/dotnet-install-sdk-steps.yml b/build/yaml/templates/dotnet-install-sdk-steps.yml
deleted file mode 100644
index 772e09f578..0000000000
--- a/build/yaml/templates/dotnet-install-sdk-steps.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-steps:
-- task: UseDotNet@2
- displayName: 'Use .Net Core sdk 2.1.x'
- inputs:
- version: 2.1.x
-
-- task: UseDotNet@2
- displayName: 'Use .Net Core sdk 3.1.x'
- inputs:
- version: 3.1.x
diff --git a/build/yaml/templates/dotnet-package-steps.yml b/build/yaml/templates/dotnet-package-steps.yml
index 49e0a39302..106b8caa7e 100644
--- a/build/yaml/templates/dotnet-package-steps.yml
+++ b/build/yaml/templates/dotnet-package-steps.yml
@@ -1,4 +1,9 @@
steps:
+- task: UseDotNet@2
+ displayName: 'Use .Net Core sdk 2.1.x'
+ inputs:
+ version: 2.1.x
+
- task: DotNetCoreCLI@2
displayName: 'Run `dotnet publish`'
inputs:
diff --git a/build/yaml/templates/npm-versioning-steps.yml b/build/yaml/templates/npm-versioning-steps.yml
index 9cb7e95fb1..bfbe667d56 100644
--- a/build/yaml/templates/npm-versioning-steps.yml
+++ b/build/yaml/templates/npm-versioning-steps.yml
@@ -13,7 +13,7 @@ steps:
$deploymentRing = $deploymentRingOverride;
}
- if ($deploymentRing.ToLowerInvariant() -eq "rc") {
+ if (($deploymentRing.ToLowerInvariant() -eq "rc") -or ($deploymentRing.ToLowerInvariant() -eq "preview")) {
$releaseCandidateNumber = "$env:RELEASECANDIDATENUMBER";
"Release Candidate Number = $releaseCandidateNumber";
diff --git a/build/yaml/templates/nuget-signing-steps.yml b/build/yaml/templates/nuget-signing-steps.yml
index 5e08c14ebe..269af981c7 100644
--- a/build/yaml/templates/nuget-signing-steps.yml
+++ b/build/yaml/templates/nuget-signing-steps.yml
@@ -2,11 +2,6 @@
# Extra steps are required to sign the binaries of the code extensions.
steps:
-- task: UseDotNet@2
- displayName: 'Use .Net Core sdk 2.1.x'
- inputs:
- version: 2.1.x
-
- task: CopyFiles@2
displayName: 'Copy packages to Signing'
inputs:
diff --git a/build/yaml/templates/nuget-versioning-steps.yml b/build/yaml/templates/nuget-versioning-steps.yml
index 1e9f430aa5..9192584a46 100644
--- a/build/yaml/templates/nuget-versioning-steps.yml
+++ b/build/yaml/templates/nuget-versioning-steps.yml
@@ -13,7 +13,7 @@ steps:
$deploymentRing = $deploymentRingOverride;
}
- if ($deploymentRing.ToLowerInvariant() -eq "rc") {
+ if (($deploymentRing.ToLowerInvariant() -eq "rc") -or ($deploymentRing.ToLowerInvariant() -eq "preview")) {
$releaseCandidateNumber = "$env:RELEASECANDIDATENUMBER";
"Release Candidate Number = $releaseCandidateNumber";
diff --git a/generators/generator-bot-adaptive/package.json b/generators/generator-bot-adaptive/package.json
index 98ca42a60a..83c684f825 100644
--- a/generators/generator-bot-adaptive/package.json
+++ b/generators/generator-bot-adaptive/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-adaptive",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating a base bot built on the Azure Bot Framework and the Adaptive stack.",
"keywords": [
"microsoft",
diff --git a/generators/generator-bot-adaptive/platforms.js b/generators/generator-bot-adaptive/platforms.js
index 621dd9b47a..bb01da0bf2 100644
--- a/generators/generator-bot-adaptive/platforms.js
+++ b/generators/generator-bot-adaptive/platforms.js
@@ -3,12 +3,12 @@
const dotnet = {
name: 'dotnet',
- defaultSdkVersion: '4.13.2',
+ defaultSdkVersion: '4.14.0',
};
const js = {
name: 'js',
- defaultSdkVersion: '4.13.4-preview',
+ defaultSdkVersion: '4.14.0-preview.rc1',
};
module.exports = { dotnet, js };
diff --git a/generators/generator-bot-adaptive/test/dotnet-functions.test.js b/generators/generator-bot-adaptive/test/dotnet-functions.test.js
index 04cb7cd664..03791be1b7 100644
--- a/generators/generator-bot-adaptive/test/dotnet-functions.test.js
+++ b/generators/generator-bot-adaptive/test/dotnet-functions.test.js
@@ -125,7 +125,7 @@ describe(`generator-bot-adaptive --platform ${platform} --integration ${integrat
{
botName,
packageReferences: '',
- sdkVersion: '4.13.2',
+ sdkVersion: '4.14.0',
}
);
diff --git a/generators/generator-bot-adaptive/test/dotnet-webapp.test.js b/generators/generator-bot-adaptive/test/dotnet-webapp.test.js
index b3a99461ab..21d6271ac2 100644
--- a/generators/generator-bot-adaptive/test/dotnet-webapp.test.js
+++ b/generators/generator-bot-adaptive/test/dotnet-webapp.test.js
@@ -106,7 +106,7 @@ describe(`generator-bot-adaptive --platform ${platform} --integration ${integrat
{
botName,
packageReferences: '',
- sdkVersion: '4.13.2',
+ sdkVersion: '4.14.0',
}
);
diff --git a/generators/generator-bot-adaptive/test/js-functions.test.js b/generators/generator-bot-adaptive/test/js-functions.test.js
index c3c990981a..0d0ed536b5 100644
--- a/generators/generator-bot-adaptive/test/js-functions.test.js
+++ b/generators/generator-bot-adaptive/test/js-functions.test.js
@@ -107,10 +107,10 @@ describe(`generator-bot-adaptive --platform ${platform} --integration ${integrat
},
dependencies: {
'cross-env': 'latest',
- 'botbuilder-ai-luis': '4.13.4-preview',
- 'botbuilder-ai-qna': '4.13.4-preview',
+ 'botbuilder-ai-luis': '4.14.0-preview.rc1',
+ 'botbuilder-ai-qna': '4.14.0-preview.rc1',
'botbuilder-dialogs-adaptive-runtime-integration-azure-functions':
- '4.13.4-preview',
+ '4.14.0-preview.rc1',
},
};
diff --git a/generators/generator-bot-adaptive/test/js-webapp.test.js b/generators/generator-bot-adaptive/test/js-webapp.test.js
index 2028572509..679d2f74dc 100644
--- a/generators/generator-bot-adaptive/test/js-webapp.test.js
+++ b/generators/generator-bot-adaptive/test/js-webapp.test.js
@@ -86,10 +86,10 @@ describe(`generator-bot-adaptive --platform ${platform} --integration ${integrat
},
dependencies: {
'cross-env': 'latest',
- 'botbuilder-ai-luis': '4.13.4-preview',
- 'botbuilder-ai-qna': '4.13.4-preview',
+ 'botbuilder-ai-luis': '4.14.0-preview.rc1',
+ 'botbuilder-ai-qna': '4.14.0-preview.rc1',
'botbuilder-dialogs-adaptive-runtime-integration-express':
- '4.13.4-preview',
+ '4.14.0-preview.rc1',
},
};
diff --git a/generators/generator-bot-core-assistant/generators/app/index.js b/generators/generator-bot-core-assistant/generators/app/index.js
index b19b308c8c..e94d490605 100644
--- a/generators/generator-bot-core-assistant/generators/app/index.js
+++ b/generators/generator-bot-core-assistant/generators/app/index.js
@@ -12,11 +12,11 @@ const packageReferences = {
[platforms.dotnet.name]: [
{
name: 'Microsoft.Bot.Components.HelpAndCancel',
- version: '1.0.0',
+ version: '1.1.0-preview.0',
},
],
[platforms.js.name]: [
- { name: '@microsoft/bot-components-helpandcancel', version: 'latest' },
+ { name: '@microsoft/bot-components-helpandcancel', version: 'next' },
],
};
diff --git a/generators/generator-bot-core-assistant/package.json b/generators/generator-bot-core-assistant/package.json
index 22944a9a4b..4409105f09 100644
--- a/generators/generator-bot-core-assistant/package.json
+++ b/generators/generator-bot-core-assistant/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-core-assistant",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating an assistant-style bot with NLP built on the Azure Bot Framework.",
"keywords": [
"microsoft",
@@ -24,7 +24,7 @@
"lint": "eslint -c ../../.eslintrc.json ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0-preview.0",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
},
diff --git a/generators/generator-bot-core-language/generators/app/index.js b/generators/generator-bot-core-language/generators/app/index.js
index e831c00de2..4e8f46b514 100644
--- a/generators/generator-bot-core-language/generators/app/index.js
+++ b/generators/generator-bot-core-language/generators/app/index.js
@@ -12,16 +12,16 @@ const packageReferences = {
[platforms.dotnet.name]: [
{
name: 'Microsoft.Bot.Components.HelpAndCancel',
- version: '1.0.0',
+ version: '1.1.0-preview.0',
},
{
name: 'Microsoft.Bot.Components.Welcome',
- version: '1.0.0',
+ version: '1.1.0-preview.0',
},
],
[platforms.js.name]: [
- { name: '@microsoft/bot-components-helpandcancel', version: 'latest' },
- { name: '@microsoft/bot-components-welcome', version: 'latest' },
+ { name: '@microsoft/bot-components-helpandcancel', version: 'next' },
+ { name: '@microsoft/bot-components-welcome', version: 'next' },
],
};
diff --git a/generators/generator-bot-core-language/package.json b/generators/generator-bot-core-language/package.json
index 5cecb71f13..72a347e11d 100644
--- a/generators/generator-bot-core-language/package.json
+++ b/generators/generator-bot-core-language/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-core-language",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating a simple conversational bot with NLP built on the Azure Bot Framework.",
"keywords": [
"microsoft",
@@ -26,7 +26,7 @@
"lint": "eslint -c ../../.eslintrc.json ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
},
diff --git a/generators/generator-bot-core-qna/package.json b/generators/generator-bot-core-qna/package.json
index 9692356e3e..2acfcfa686 100644
--- a/generators/generator-bot-core-qna/package.json
+++ b/generators/generator-bot-core-qna/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-core-qna",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating a bot and connecting to a QnA Maker knowledge base.",
"keywords": [
"microsoft",
@@ -23,7 +23,7 @@
"lint": "eslint -c ../../.eslintrc.json ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0-preview.0",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
},
diff --git a/generators/generator-bot-empty/package.json b/generators/generator-bot-empty/package.json
index a4cdb7f0ff..7bbd901cf6 100644
--- a/generators/generator-bot-empty/package.json
+++ b/generators/generator-bot-empty/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-empty",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating an empty bot built on the Azure Bot Framework.",
"keywords": [
"microsoft",
@@ -26,7 +26,7 @@
"lint": "eslint -c ../../.eslintrc.json ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0-preview.0",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
},
diff --git a/generators/generator-bot-enterprise-assistant/generators/app/index.js b/generators/generator-bot-enterprise-assistant/generators/app/index.js
index 33ed5d2b6f..2ed01c6b0e 100644
--- a/generators/generator-bot-enterprise-assistant/generators/app/index.js
+++ b/generators/generator-bot-enterprise-assistant/generators/app/index.js
@@ -36,7 +36,7 @@ module.exports = class extends BaseGenerator {
{
isPlugin: true,
name: 'Microsoft.Bot.Builder.AI.Orchestrator',
- version: '4.13.2',
+ version: '4.14.0',
},
],
modifyApplicationSettings: (appSettings) => {
diff --git a/generators/generator-bot-enterprise-assistant/package.json b/generators/generator-bot-enterprise-assistant/package.json
index c7f51f4dc0..1232ba3204 100644
--- a/generators/generator-bot-enterprise-assistant/package.json
+++ b/generators/generator-bot-enterprise-assistant/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-enterprise-assistant",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating an enterprise assistant, with a root bot and two skills built on the Azure Bot Framework.",
"keywords": [
"microsoft",
@@ -25,9 +25,9 @@
"lint": "eslint -c ../../.eslintrc.json ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
- "@microsoft/generator-bot-enterprise-calendar": "workspace:^1.0.0",
- "@microsoft/generator-bot-enterprise-people": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0-preview.0",
+ "@microsoft/generator-bot-enterprise-calendar": "workspace:^1.1.0-preview.0",
+ "@microsoft/generator-bot-enterprise-people": "workspace:^1.1.0-preview.0",
"uuid": "^8.3.2",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
diff --git a/generators/generator-bot-enterprise-calendar/generators/app/index.js b/generators/generator-bot-enterprise-calendar/generators/app/index.js
index 64202cef42..586eb8dc6d 100644
--- a/generators/generator-bot-enterprise-calendar/generators/app/index.js
+++ b/generators/generator-bot-enterprise-calendar/generators/app/index.js
@@ -16,7 +16,7 @@ module.exports = class extends BaseGenerator {
{
isPlugin: true,
name: 'Microsoft.Bot.Components.Graph',
- version: '1.0.0',
+ version: '1.1.0-preview.0',
},
],
modifyApplicationSettings: (appSettings) => {
diff --git a/generators/generator-bot-enterprise-calendar/package.json b/generators/generator-bot-enterprise-calendar/package.json
index 419f85cefa..cd491abfdf 100644
--- a/generators/generator-bot-enterprise-calendar/package.json
+++ b/generators/generator-bot-enterprise-calendar/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-enterprise-calendar",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating an Adaptive bot built on the Azure Bot Framework using the Calendar template.",
"keywords": [
"microsoft",
@@ -24,7 +24,7 @@
"lint": "eslint ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0-preview.0",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
},
diff --git a/generators/generator-bot-enterprise-people/generators/app/index.js b/generators/generator-bot-enterprise-people/generators/app/index.js
index d85abc8a14..2fde064d9f 100644
--- a/generators/generator-bot-enterprise-people/generators/app/index.js
+++ b/generators/generator-bot-enterprise-people/generators/app/index.js
@@ -16,7 +16,7 @@ module.exports = class extends BaseGenerator {
{
isPlugin: true,
name: 'Microsoft.Bot.Components.Graph',
- version: '1.0.0',
+ version: '1.1.0-preview.0',
},
],
modifyApplicationSettings: (appSettings) => {
diff --git a/generators/generator-bot-enterprise-people/package.json b/generators/generator-bot-enterprise-people/package.json
index 7e8b5bb1f8..446e84f18b 100644
--- a/generators/generator-bot-enterprise-people/package.json
+++ b/generators/generator-bot-enterprise-people/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/generator-bot-enterprise-people",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Yeoman generator for creating an Adaptive bot built on the Azure Bot Framework using the People template.",
"keywords": [
"microsoft",
@@ -24,7 +24,7 @@
"lint": "eslint -c ../../.eslintrc.json ."
},
"dependencies": {
- "@microsoft/generator-bot-adaptive": "workspace:^1.0.0",
+ "@microsoft/generator-bot-adaptive": "workspace:^1.1.0-preview.0",
"yeoman-generator": "^2.0.5",
"yeoman-test": "^1.9.1"
},
diff --git a/package.json b/package.json
index 7a69ff9c32..33608161e5 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,8 @@
"packages/*",
"packages/*/js",
"skills/declarative/*",
- "testing/*"
+ "tests/**/js",
+ "!tests/functional"
],
"scripts": {
"lint": "yarn workspaces foreach run lint"
diff --git a/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj b/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj
index ebcd529718..07be44f462 100644
--- a/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj
+++ b/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj
@@ -8,7 +8,7 @@
Microsoft.Bot.Components.AdaptiveCards
https://github.com/microsoft/botframework-components/tree/main/packages/AdaptiveCards
- 1.0.0
+ 1.1.0
Composer triggers and actions for working with Adaptive Cards.
Composer triggers and actions for working with Adaptive Cards.
true
@@ -20,7 +20,7 @@
-
+
diff --git a/packages/Graph/Microsoft.Bot.Components.Graph.csproj b/packages/Graph/Microsoft.Bot.Components.Graph.csproj
index 7e09985822..7c15909684 100644
--- a/packages/Graph/Microsoft.Bot.Components.Graph.csproj
+++ b/packages/Graph/Microsoft.Bot.Components.Graph.csproj
@@ -7,7 +7,7 @@
Microsoft.Bot.Components.Graph
- 1.0.0
+ 1.1.0
Custom actions for the MS Graph API for Bot Framework bots.
A set of custom actions for working with the Microsoft Graph API from Bot Framework Composer.
https://github.com/Microsoft/botframework-components/tree/main/packages/Graph
@@ -20,7 +20,7 @@
-
+
all
diff --git a/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec b/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec
index dd564f2118..b23ac3a951 100644
--- a/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec
+++ b/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec
@@ -2,7 +2,7 @@
Microsoft.Bot.Components.HelpAndCancel
- 1.0.0
+ 1.1.0
Microsoft
Microsoft
© Microsoft Corporation. All rights reserved.
@@ -13,7 +13,7 @@
Contains Adaptive Dialog assets to support Help and Cancel conversational flows in a bot built on the Azure Bot Framework.
msbot-component msbot-content conversationalcore helpintent cancelintent preview
-
+
diff --git a/packages/HelpAndCancel/package.json b/packages/HelpAndCancel/package.json
index 72ba223afc..ab2a9a19b8 100644
--- a/packages/HelpAndCancel/package.json
+++ b/packages/HelpAndCancel/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/bot-components-helpandcancel",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "Contains Adaptive Dialog assets to support Help and Cancel conversational flows in a bot built on the Azure Bot Framework.",
"keywords": [
"microsoft",
diff --git a/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs b/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs
index 912b8beecf..9f65d59452 100644
--- a/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs
+++ b/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs
@@ -2,7 +2,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
+using System.Linq;
using System.Runtime.CompilerServices;
+using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using AdaptiveExpressions.Properties;
@@ -118,23 +120,52 @@ public SendMessageToTeamsChannel([CallerFilePath] string callerPath = "", [Calle
teamsChannelId = dc.Context.Activity.TeamsGetChannelId();
}
- if (!(dc.Context.Adapter is BotFrameworkAdapter))
+ Tuple result;
+
+ // Check for legacy adapter
+ if (dc.Context.Adapter is BotFrameworkAdapter)
+ {
+ // TeamsInfo.SendMessageToTeamsChannelAsync requires AppCredentials
+ var credentials = dc.Context.TurnState.Get()?.Credentials as MicrosoftAppCredentials;
+ if (credentials == null)
+ {
+ throw new InvalidOperationException($"Missing credentials as {nameof(MicrosoftAppCredentials)} in {nameof(IConnectorClient)} from TurnState");
+ }
+
+ // The result comes back as a tuple, which is used to set the two properties (if present).
+ result = await TeamsInfo.SendMessageToTeamsChannelAsync(dc.Context, activity, teamsChannelId, credentials, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ else if (dc.Context.Adapter is CloudAdapterBase)
{
- throw new InvalidOperationException($"{Kind} is not supported by the current adapter.");
+ // Retrieve the bot appid from TurnState's ClaimsIdentity
+ string appId;
+ if (dc.Context.TurnState.Get(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity)
+ {
+ // Apparently 'version' is sometimes empty, which will result in no id returned from GetAppIdFromClaims
+ appId = JwtTokenValidation.GetAppIdFromClaims(botIdentity.Claims);
+ if (string.IsNullOrEmpty(appId))
+ {
+ appId = botIdentity.Claims.FirstOrDefault(claim => claim.Type == AuthenticationConstants.AudienceClaim)?.Value;
+ }
+
+ if (string.IsNullOrEmpty(appId))
+ {
+ throw new InvalidOperationException($"Missing AppIdClaim in ClaimsIdentity.");
+ }
+ }
+ else
+ {
+ throw new InvalidOperationException($"Missing {BotAdapter.BotIdentityKey} in {nameof(ITurnContext)} TurnState.");
+ }
+
+ // The result comes back as a tuple, which is used to set the two properties (if present).
+ result = await TeamsInfo.SendMessageToTeamsChannelAsync(dc.Context, activity, teamsChannelId, appId, cancellationToken: cancellationToken).ConfigureAwait(false);
}
-
- // TODO: this will NOT work with certificate app credentials
-
- // TeamsInfo.SendMessageToTeamsChannelAsync requires AppCredentials
- var credentials = dc.Context.TurnState.Get()?.Credentials as MicrosoftAppCredentials;
- if (credentials == null)
+ else
{
- throw new InvalidOperationException($"Missing credentials as {nameof(MicrosoftAppCredentials)} in {nameof(IConnectorClient)} from TurnState");
+ throw new InvalidOperationException($"The adapter does not support {nameof(SendMessageToTeamsChannel)}.");
}
- // The result comes back as a tuple, which is used to set the two properties (if present).
- var result = await TeamsInfo.SendMessageToTeamsChannelAsync(dc.Context, activity, teamsChannelId, credentials, cancellationToken: cancellationToken).ConfigureAwait(false);
-
if (ConversationReferenceProperty != null)
{
dc.State.SetValue(ConversationReferenceProperty.GetValue(dc.State), result.Item1);
diff --git a/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj b/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj
index d333f2f004..60f5b87f7b 100644
--- a/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj
+++ b/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj
@@ -3,7 +3,7 @@
netstandard2.0
Microsoft.Bot.Components.Teams
- 1.0.0
+ 1.1.0
This library implements .NET support for adaptive dialogs with Microsoft Teams
This library implements .NET support for adaptive dialogs with Microsoft Teams
https://github.com/Microsoft/botframework-components/tree/main/packages/Teams/dotnet
@@ -35,7 +35,7 @@
-
+
diff --git a/packages/Teams/js/package.json b/packages/Teams/js/package.json
index 3dafdda466..1dc2ed2a17 100644
--- a/packages/Teams/js/package.json
+++ b/packages/Teams/js/package.json
@@ -2,7 +2,7 @@
"name": "@microsoft/bot-components-teams",
"author": "Microsoft Corp.",
"description": "Rule system for the Microsoft BotBuilder adaptive dialog system, with integration specific to Microsoft Teams.",
- "version": "1.0.0",
+ "version": "1.1.0",
"license": "MIT",
"keywords": [
"msbot-component",
@@ -29,28 +29,31 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"peerDependencies": {
- "adaptive-expressions": "~4.13.4",
- "botbuilder": "~4.13.4",
- "botbuilder-dialogs": "~4.13.4",
- "botbuilder-dialogs-adaptive": "~4.13.4-preview",
- "botbuilder-dialogs-adaptive-runtime-core": "~4.13.4-preview",
- "botbuilder-dialogs-declarative": "~4.13.4-preview",
- "botbuilder-stdlib": "~4.13.4-internal",
+ "adaptive-expressions": "~4.14.0",
+ "botbuilder": "~4.14.0",
+ "botbuilder-dialogs": "~4.14.0",
+ "botbuilder-dialogs-adaptive": "~4.14.0-preview",
+ "botbuilder-dialogs-adaptive-runtime-core": "~4.14.0-preview",
+ "botbuilder-dialogs-declarative": "~4.14.0-preview",
+ "botbuilder-stdlib": "~4.14.0-internal",
+ "botframework-connector": "~4.14.0",
"lodash": "^4.17.21"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
"@types/lodash": "^4.14.168",
- "@typescript-eslint/eslint-plugin": "latest",
- "@typescript-eslint/parser": "latest",
- "adaptive-expressions": "4.13.4",
- "botbuilder": "4.13.4",
- "botbuilder-dialogs": "4.13.4",
- "botbuilder-dialogs-adaptive": "4.13.4-preview",
- "botbuilder-dialogs-adaptive-runtime-core": "4.13.4-preview",
- "botbuilder-dialogs-declarative": "4.13.4-preview",
- "botbuilder-stdlib": "4.13.4-internal",
- "eslint": "latest",
+ "@typescript-eslint/eslint-plugin": "^4.28.2",
+ "@typescript-eslint/parser": "^4.28.2",
+ "adaptive-expressions": "4.14.0",
+ "botbuilder": "4.14.0",
+ "botbuilder-dialogs": "4.14.0",
+ "botbuilder-dialogs-adaptive": "4.14.0-preview",
+ "botbuilder-dialogs-adaptive-runtime-core": "4.14.0-preview",
+ "botbuilder-dialogs-declarative": "4.14.0-preview",
+ "botbuilder-stdlib": "4.14.0-internal",
+ "botframework-connector": "4.14.0",
+ "eslint": "^7.30.0",
+ "eslint-plugin-prettier": "latest",
"lodash": "^4.17.21",
"rimraf": "^3.0.2",
"typescript": "^4.0.5"
diff --git a/packages/Teams/js/src/actions/actionHelpers.ts b/packages/Teams/js/src/actions/actionHelpers.ts
index 60e118e449..32dfc8fe38 100644
--- a/packages/Teams/js/src/actions/actionHelpers.ts
+++ b/packages/Teams/js/src/actions/actionHelpers.ts
@@ -35,10 +35,10 @@ export function getValue(
* BotFrameworkAdapter and TestAdapter contain them, so we just need to make sure that dc.context.adapter contains
* an adapter with the appropriate auth methods.
*/
-export interface HasAuthMethods {
- getUserToken: typeof BotFrameworkAdapter.prototype.getUserToken;
- getSignInLink: typeof BotFrameworkAdapter.prototype.getSignInLink;
-}
+export type HasAuthMethods = Pick<
+ BotFrameworkAdapter,
+ 'getUserToken' | 'getSignInLink'
+>;
/**
* Test to assert val has required auth methods.
@@ -55,3 +55,27 @@ export const testAdapterHasAuthMethods: Test = (
tests.isFunc((val as BotFrameworkAdapter).getSignInLink))
);
};
+
+/**
+ * This is similar to HasAuthMethods, but purely for testing since TestAdapter does not have
+ * createConnectorClient, but BotFrameworkAdapter does.
+ */
+export type HasCreateConnectorClientMethod = Pick<
+ BotFrameworkAdapter,
+ 'createConnectorClient'
+>;
+
+/**
+ * Test to assert val has required createConnectorClient method.
+ *
+ * @param {any} val Usually context.adapter.
+ * @returns {Assertion} Asserts that val has required createConnectorClient method.
+ */
+export const testAdapterHasCreateConnectorClientMethod: Test = (
+ val: unknown
+): val is HasCreateConnectorClientMethod => {
+ return (
+ val instanceof BotFrameworkAdapter ||
+ tests.isFunc((val as BotFrameworkAdapter).createConnectorClient)
+ );
+};
diff --git a/packages/Teams/js/src/actions/baseAuthResponseDialog.ts b/packages/Teams/js/src/actions/baseAuthResponseDialog.ts
index 9d9a5cfa88..e16eed86f4 100644
--- a/packages/Teams/js/src/actions/baseAuthResponseDialog.ts
+++ b/packages/Teams/js/src/actions/baseAuthResponseDialog.ts
@@ -2,7 +2,13 @@
// Licensed under the MIT License.
import isEmpty from 'lodash/isEmpty';
-import { ActionTypes, Activity, CardAction, TokenResponse } from 'botbuilder';
+import {
+ ActionTypes,
+ Activity,
+ CardAction,
+ CloudAdapterBase,
+ TokenResponse,
+} from 'botbuilder';
import {
BoolExpressionConverter,
Expression,
@@ -22,6 +28,7 @@ import {
BaseTeamsCacheInfoResponseDialog,
BaseTeamsCacheInfoResponseDialogConfiguration,
} from './baseTeamsCacheInfoResponseDialog';
+import { UserTokenClient } from 'botframework-connector';
export interface BaseAuthResponseDialogConfiguration
extends BaseTeamsCacheInfoResponseDialogConfiguration {
@@ -98,8 +105,8 @@ export abstract class BaseAuthResponseDialog
if (tokenResponse) {
// We have the token, so the user is already signed in.
// Similar to OAuthInput, just return the token in the property.
- if (this.property != null) {
- dc.state.setValue(this.property?.getValue(dc.state), tokenResponse);
+ if (this.property) {
+ dc.state.setValue(this.property.getValue(dc.state), tokenResponse);
}
// End the dialog and return the token response.
@@ -125,19 +132,32 @@ export abstract class BaseAuthResponseDialog
* @param {CardAction} _cardAction CardAction with a valid Sign In Link.
* @returns {Partial} Promise representing the InvokeResponse Activity specific to this type of auth dialog.
*/
- protected createOAuthInvokeResponseActivityFromCardAction(
+ protected abstract createOAuthInvokeResponseActivityFromCardAction(
_dc: DialogContext,
_cardAction: CardAction
- ): Partial {
- throw new Error('NotImplemented');
- }
+ ): Partial;
private async createOAuthInvokeResponseActivityFromTitleAndConnectionName(
dc: DialogContext,
- title?: string,
- connectionName?: string
+ title: string,
+ connectionName: string
): Promise> {
- // TODO: Switch to using Cloud OAuth after this PR gets merged: https://github.com/microsoft/botbuilder-js/pull/3149
+ const userTokenClient = dc.context.turnState.get(
+ (dc.context.adapter as CloudAdapterBase).UserTokenClientKey
+ );
+ if (userTokenClient) {
+ const signInResource = await userTokenClient.getSignInResource(
+ connectionName,
+ dc.context.activity,
+ ''
+ );
+ return this.createOAuthInvokeResponseActivityFromTitleAndSignInLink(
+ dc,
+ title,
+ signInResource.signInLink as string
+ );
+ }
+
if (!testAdapterHasAuthMethods(dc.context.adapter)) {
throw new Error('Auth is not supported by the current adapter.');
} else if (!title || !connectionName) {
@@ -176,13 +196,27 @@ export abstract class BaseAuthResponseDialog
dc: DialogContext,
connectionName: string
): Promise {
- // TODO: Switch to using Cloud OAuth after this PR gets merged: https://github.com/microsoft/botbuilder-js/pull/3149
+ // When the Bot Service Auth flow completes, the action.State will contain a magic code used for verification.
+ const state = dc.context.activity.value?.state;
+
+ const userTokenClient = dc.context.turnState.get(
+ (dc.context.adapter as CloudAdapterBase).UserTokenClientKey
+ );
+ if (userTokenClient) {
+ return userTokenClient.getUserToken(
+ dc.context.activity.from?.id,
+ connectionName,
+ dc.context.activity.channelId,
+ state
+ );
+ }
+
if (!testAdapterHasAuthMethods(dc.context.adapter)) {
throw new Error('Auth is not supported by the current adapter.');
}
// When the Bot Service Auth flow completes, the action.State will contain a magic code used for verification.
- const magicCode = !isEmpty(dc.context.activity?.value)
+ const magicCode = !isEmpty(dc.context.activity.value)
? dc.context.activity.value.state
: undefined;
diff --git a/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts b/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts
index 6f0546054b..54d6a17cbc 100644
--- a/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts
+++ b/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts
@@ -8,7 +8,13 @@ import {
StringExpression,
StringExpressionConverter,
} from 'adaptive-expressions';
-import { Activity, Channels, TeamsInfo } from 'botbuilder';
+import {
+ Activity,
+ Channels,
+ CloudAdapterBase,
+ ConversationReference,
+ TeamsInfo,
+} from 'botbuilder';
import {
Converter,
ConverterFactory,
@@ -19,8 +25,17 @@ import {
DialogTurnResult,
TemplateInterface,
} from 'botbuilder-dialogs';
+import {
+ AuthenticationConstants,
+ ClaimsIdentity,
+ ConnectorClient,
+ JwtTokenValidation,
+} from 'botframework-connector';
import { ActivityTemplateConverter } from 'botbuilder-dialogs-adaptive/lib/converters';
-import { getValue } from './actionHelpers';
+import {
+ getValue,
+ testAdapterHasCreateConnectorClientMethod,
+} from './actionHelpers';
export interface SendMessageToTeamsChannelConfiguration
extends DialogConfiguration {
@@ -124,11 +139,58 @@ export class SendMessageToTeamsChannel
getValue(dc, this.teamsChannelId) ??
dc.context?.activity.channelData?.channel?.id;
- const result = await TeamsInfo.sendMessageToTeamsChannel(
- dc.context,
- activity,
- teamsChannelId
- );
+ let result: [ConversationReference, string];
+
+ // Check for legacy adapter
+ if (testAdapterHasCreateConnectorClientMethod(dc.context.adapter)) {
+ const credentials = dc.context.turnState.get(
+ dc.context.adapter.ConnectorClientKey
+ )?.credentials;
+ if (!credentials) {
+ throw new Error(
+ 'Missing credentials as MicrosoftAppCredentials in ConnectorClient from TurnState'
+ );
+ }
+
+ result = await TeamsInfo.sendMessageToTeamsChannel(
+ dc.context,
+ activity,
+ teamsChannelId
+ );
+ } else if (dc.context.adapter instanceof CloudAdapterBase) {
+ const botIdentity = dc.context.turnState.get(
+ dc.context.adapter.BotIdentityKey
+ );
+
+ let appId: string | undefined;
+ if (botIdentity) {
+ // 'version' is sometimes empty, which will result in no id returned from GetAppIdFromClaims.
+ appId = JwtTokenValidation.getAppIdFromClaims(botIdentity.claims);
+
+ if (!appId) {
+ appId = botIdentity.claims.find(
+ (claim) => claim.type === AuthenticationConstants.AudienceClaim
+ )?.value;
+ }
+
+ if (!appId) {
+ throw new Error('Missing AppIdClaim in ClaimsIdentity');
+ }
+ } else {
+ throw new Error(
+ 'Missing dc.context.adapter.BotIdentityKey in TurnContext TurnState'
+ );
+ }
+
+ result = await TeamsInfo.sendMessageToTeamsChannel(
+ dc.context,
+ activity,
+ teamsChannelId,
+ appId
+ );
+ } else {
+ throw new Error('The adapter does not support SendMessageToTeamsChannel');
+ }
if (this.conversationReferenceProperty != null) {
dc.state.setValue(
diff --git a/packages/Teams/js/src/actions/sendTabCardResponse.ts b/packages/Teams/js/src/actions/sendTabCardResponse.ts
index a4f83ba764..641b59365e 100644
--- a/packages/Teams/js/src/actions/sendTabCardResponse.ts
+++ b/packages/Teams/js/src/actions/sendTabCardResponse.ts
@@ -2,6 +2,7 @@
// Licensed under the MIT License.
import {
+ BoolExpression,
BoolExpressionConverter,
StringExpressionConverter,
} from 'adaptive-expressions';
@@ -16,47 +17,45 @@ import {
import {
Converter,
ConverterFactory,
+ Dialog,
DialogContext,
DialogStateManager,
DialogTurnResult,
TemplateInterface,
} from 'botbuilder-dialogs';
import { ActivityTemplateConverter } from 'botbuilder-dialogs-adaptive/lib/converters';
-import {
- BaseAuthResponseDialog,
- BaseAuthResponseDialogConfiguration,
-} from './baseAuthResponseDialog';
-export interface SendTabCardResponseConfiguration
- extends BaseAuthResponseDialogConfiguration {
+export interface SendTabCardResponseConfiguration extends Dialog {
cards?: TemplateInterface;
+ disabled?: boolean | string | BoolExpression;
}
/**
* Send a Card Tab response to the user.
*/
-export class SendTabCardResponse
- extends BaseAuthResponseDialog
- implements BaseAuthResponseDialogConfiguration {
+export class SendTabCardResponse extends Dialog {
/**
* Class identifier.
*/
public static $kind = 'Teams.SendTabCardResponse';
+ /**
+ * Gets or sets an optional expression which if is true will disable this action.
+ */
+ public disabled?: BoolExpression;
+
/**
* Template for the activity expression containing Adaptive Cards to send.
*/
public cards?: TemplateInterface;
public getConverter(
- property: keyof BaseAuthResponseDialogConfiguration | string
+ property: keyof Dialog | string
): Converter | ConverterFactory {
switch (property) {
case 'disabled':
return new BoolExpressionConverter();
case 'property':
- case 'connectionName':
- case 'title':
return new StringExpressionConverter();
case 'cards':
return new ActivityTemplateConverter();
@@ -114,7 +113,7 @@ export class SendTabCardResponse
*/
protected onComputeId(): string {
return `SendTabCardResponse[\
- ${this.title?.toString() ?? ''}\
+ ${this.cards?.toString() ?? ''}\
]`;
}
diff --git a/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec b/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec
index 43d5a1026d..06132ce5ff 100644
--- a/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec
+++ b/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec
@@ -2,7 +2,7 @@
Microsoft.Bot.Components.Welcome
- 1.0.0
+ 1.1.0
Microsoft
Microsoft
© Microsoft Corporation. All rights reserved.
@@ -13,7 +13,7 @@
An Adaptive Dialog for greeting new and returning users on first interaction with your bot built on the Azure Bot Framework.
msbot-component msbot-content conversationalcore welcome preview
-
+
diff --git a/packages/Welcome/package.json b/packages/Welcome/package.json
index 1997adafb9..bec7b8d8ab 100644
--- a/packages/Welcome/package.json
+++ b/packages/Welcome/package.json
@@ -1,6 +1,6 @@
{
"name": "@microsoft/bot-components-welcome",
- "version": "1.0.0",
+ "version": "1.1.0",
"description": "An Adaptive Dialog for greeting new and returning users on first interaction with your bot built on the Azure Bot Framework.",
"keywords": [
"microsoft",
diff --git a/skills/csharp/calendarskill/CalendarSkill.csproj b/skills/csharp/calendarskill/CalendarSkill.csproj
index 58f7186653..d3dba0f5ae 100644
--- a/skills/csharp/calendarskill/CalendarSkill.csproj
+++ b/skills/csharp/calendarskill/CalendarSkill.csproj
@@ -14,7 +14,7 @@
-
+
diff --git a/skills/declarative/Calendar/Calendar/Calendar.csproj b/skills/declarative/Calendar/Calendar/Calendar.csproj
index 7fe5d77eb9..b651cc6a72 100644
--- a/skills/declarative/Calendar/Calendar/Calendar.csproj
+++ b/skills/declarative/Calendar/Calendar/Calendar.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/skills/declarative/People/People/People.csproj b/skills/declarative/People/People/People.csproj
index 9b4d6229b0..9510a64c0f 100644
--- a/skills/declarative/People/People/People.csproj
+++ b/skills/declarative/People/People/People.csproj
@@ -12,9 +12,9 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json
index bddc987858..a36b9f459d 100644
--- a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json
+++ b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json
@@ -15,8 +15,8 @@
"url": "https://github.com"
},
"dependencies": {
- "botbuilder": "~4.13.3",
- "botbuilder-dialogs": "~4.13.3",
+ "botbuilder": "4.14.0-rc0",
+ "botbuilder-dialogs": "~4.14.0-rc0",
"dotenv": "~8.2.0",
"restify": "~8.5.1"
},
diff --git a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json
index 197d3fb53a..378267472e 100644
--- a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json
+++ b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json
@@ -15,8 +15,8 @@
"url": "https://github.com"
},
"dependencies": {
- "botbuilder": "~4.13.3",
- "botbuilder-dialogs": "~4.13.3",
+ "botbuilder": "~4.14.0-rc0",
+ "botbuilder-dialogs": "~4.14.0-rc0",
"dotenv": "~8.2.0",
"restify": "~8.5.1"
},
diff --git a/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json b/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json
index ff06ea8e8e..507be68816 100644
--- a/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json
+++ b/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json
@@ -15,7 +15,7 @@
"url": "https://github.com"
},
"dependencies": {
- "botbuilder": "~4.13.3",
+ "botbuilder": "~4.14.0-rc0",
"dotenv": "^8.2.0",
"restify": "~8.5.1"
},
diff --git a/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json b/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json
index f7990840f7..678f147e71 100644
--- a/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json
+++ b/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json
@@ -15,8 +15,8 @@
"url": "https://github.com"
},
"dependencies": {
- "botbuilder": "~4.13.3",
- "botbuilder-dialogs": "~4.13.3",
+ "botbuilder": "~4.14.0-rc0",
+ "botbuilder-dialogs": "~4.14.0-rc0",
"dotenv": "^8.2.0",
"node-fetch": "^2.6.1",
"restify": "~8.5.1"
diff --git a/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj b/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj
index aa4817caff..544dd18be4 100644
--- a/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj
+++ b/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj b/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj
index 357cf4ee10..86ba2118d0 100644
--- a/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj
+++ b/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/tests/unit/Microsoft.Bot.Components.Tests.sln b/tests/unit/Microsoft.Bot.Components.Tests.sln
index 74801b67a6..733f8655f9 100644
--- a/tests/unit/Microsoft.Bot.Components.Tests.sln
+++ b/tests/unit/Microsoft.Bot.Components.Tests.sln
@@ -17,10 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packages", "packages", "{73
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "teams", "teams", "{61708441-52A4-48F6-819A-B8D4C279C4C8}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Teams.Tests", "packages\Microsoft.Bot.Components.Teams.Tests\Microsoft.Bot.Components.Teams.Tests.csproj", "{F6E872DE-52B7-4372-B546-B18B5A495C73}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Graph", "..\..\packages\Graph\Microsoft.Bot.Components.Graph.csproj", "{9561BF32-D0EE-464F-981B-7E4298ACDDFB}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Teams.Tests", "packages\Teams\dotnet\Microsoft.Bot.Components.Teams.Tests.csproj", "{4005C95D-BECC-450B-927D-54C8CCF178BB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -43,14 +43,14 @@ Global
{F0E73465-DB1D-4F8A-B527-88F1E2515A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0E73465-DB1D-4F8A-B527-88F1E2515A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0E73465-DB1D-4F8A-B527-88F1E2515A5C}.Release|Any CPU.Build.0 = Release|Any CPU
- {F6E872DE-52B7-4372-B546-B18B5A495C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F6E872DE-52B7-4372-B546-B18B5A495C73}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F6E872DE-52B7-4372-B546-B18B5A495C73}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F6E872DE-52B7-4372-B546-B18B5A495C73}.Release|Any CPU.Build.0 = Release|Any CPU
{9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4005C95D-BECC-450B-927D-54C8CCF178BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4005C95D-BECC-450B-927D-54C8CCF178BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4005C95D-BECC-450B-927D-54C8CCF178BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4005C95D-BECC-450B-927D-54C8CCF178BB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -60,7 +60,7 @@ Global
{6876407A-F34E-479F-9F3C-6E6ED81EB600} = {31CBAEDA-E319-49AE-A662-AA0739205C82}
{F0E73465-DB1D-4F8A-B527-88F1E2515A5C} = {31CBAEDA-E319-49AE-A662-AA0739205C82}
{61708441-52A4-48F6-819A-B8D4C279C4C8} = {73825711-6685-48E2-BFA2-3FCDECE1A0FD}
- {F6E872DE-52B7-4372-B546-B18B5A495C73} = {61708441-52A4-48F6-819A-B8D4C279C4C8}
+ {4005C95D-BECC-450B-927D-54C8CCF178BB} = {61708441-52A4-48F6-819A-B8D4C279C4C8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2D0FB02B-704A-44E0-AECA-A4FDF6F805C5}
diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj
index 112c033e7f..ac8cdfb095 100644
--- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj
+++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj
@@ -10,8 +10,8 @@
-
-
+
+
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog
new file mode 100644
index 0000000000..85fe1ad023
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog
@@ -0,0 +1,75 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetMeetingParticipant",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetMeetingParticipant",
+ "property": "conversation.resultWithCustomProperties",
+ "meetingId": "customMeetingId",
+ "participantId": "customParticipantId",
+ "tenantId": "customTenantId"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "from": {
+ "id": "participant-id",
+ "aadObjectId": "participant-aad-id-1"
+ },
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "meeting": {
+ "id": "meeting-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.conversation.conversationType == 'personal'",
+ "conversation.result.conversation.id == 'a:oneOnOneConversationId'",
+ "conversation.result.conversation.isGroup == false",
+ "conversation.result.conversation.name == 'oneOnOne'",
+ "conversation.result.conversation.tenantId == 'tenantId-Guid'",
+ "conversation.result.meeting.role == 'Organizer'",
+ "conversation.result.user.userPrincipalName == 'userPrincipalName-1'",
+ "conversation.resultWithCustomProperties.conversation.conversationType == 'personal'",
+ "conversation.resultWithCustomProperties.conversation.id == 'a:oneOnOneConversationId'",
+ "conversation.resultWithCustomProperties.conversation.isGroup == false",
+ "conversation.resultWithCustomProperties.conversation.name == 'oneOnOne'",
+ "conversation.resultWithCustomProperties.conversation.tenantId == 'tenantId-Guid'",
+ "conversation.resultWithCustomProperties.meeting.role == 'Organizer'",
+ "conversation.resultWithCustomProperties.user.userPrincipalName == 'userPrincipalName-1'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog
new file mode 100644
index 0000000000..e4d8551cdd
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetMeetingParticipant",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetMeetingParticipant works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog
new file mode 100644
index 0000000000..eab01c2edc
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog
@@ -0,0 +1,43 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetMeetingParticipant",
+ "property": "$result",
+ "participantId": "=turn.channelData.doesNotExist"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetMeetingParticipant could not determine the participant id by expression value provided. participantId is required."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMember.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMember.test.dialog
new file mode 100644
index 0000000000..90d44b865c
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMember.test.dialog
@@ -0,0 +1,65 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetMember",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetMember",
+ "property": "conversation.resultWithCustomProperties",
+ "memberId": "customMemberId"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "from": {
+ "id": "member-id"
+ },
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "meeting": {
+ "id": "meeting-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.email == 'User.0@microsoft.com'",
+ "conversation.result.givenName == 'User'",
+ "conversation.result.id == '29:User-Id-0'",
+ "conversation.result.name == 'User Name-0'",
+ "conversation.result.objectId == 'User-0-Object-Id'",
+ "conversation.result.surname == 'Surname-0'",
+ "conversation.result.tenantId == 'tenant-id-1'",
+ "conversation.result.userPrincipalName == 'user0@microsoft.com'",
+ "conversation.resultWithCustomProperties.email == 'User.0@microsoft.com'",
+ "conversation.resultWithCustomProperties.givenName == 'User'",
+ "conversation.resultWithCustomProperties.id == '29:User-Id-0'",
+ "conversation.resultWithCustomProperties.name == 'User Name-0'",
+ "conversation.resultWithCustomProperties.objectId == 'User-0-Object-Id'",
+ "conversation.resultWithCustomProperties.surname == 'Surname-0'",
+ "conversation.resultWithCustomProperties.tenantId == 'tenant-id-1'",
+ "conversation.resultWithCustomProperties.userPrincipalName == 'user0@microsoft.com'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberError.test.dialog
new file mode 100644
index 0000000000..03ed714e8c
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetMember",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetMember works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog
new file mode 100644
index 0000000000..70b25fc571
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog
@@ -0,0 +1,43 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetMember",
+ "property": "$result",
+ "memberId": "=turn.activity.channelData.doesNotExist"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Missing MemberId in Teams.GetMember."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembers.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembers.test.dialog
new file mode 100644
index 0000000000..07dcae5c4f
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembers.test.dialog
@@ -0,0 +1,68 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetPagedMembers",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetPagedMembers",
+ "property": "conversation.resultWithCustomProperties",
+ "continuationToken": "token",
+ "pageSize": 2
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "from": {
+ "id": "member-id"
+ },
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "meeting": {
+ "id": "meeting-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.continuationToken == 'token'",
+ "conversation.result.members[0].email == 'User.0@microsoft.com'",
+ "conversation.result.members[0].id == '29:User-Id-0'",
+ "conversation.result.members[0].objectId == 'User-0-Object-Id'",
+ "conversation.result.members[1].email == 'User.1@microsoft.com'",
+ "conversation.result.members[1].id == '29:User-Id-1'",
+ "conversation.result.members[1].objectId == 'User-1-Object-Id'",
+ "conversation.result.members[2].email == 'User.2@microsoft.com'",
+ "conversation.result.members[2].id == '29:User-Id-2'",
+ "conversation.result.members[2].objectId == 'User-2-Object-Id'",
+ "conversation.resultWithCustomProperties.continuationToken == 'customToken'",
+ "conversation.resultWithCustomProperties.members[0].email == 'User.0@microsoft.com'",
+ "conversation.resultWithCustomProperties.members[0].id == '29:User-Id-0'",
+ "conversation.resultWithCustomProperties.members[0].objectId == 'User-0-Object-Id'",
+ "conversation.resultWithCustomProperties.members[1].email == 'User.1@microsoft.com'",
+ "conversation.resultWithCustomProperties.members[1].id == '29:User-Id-1'",
+ "conversation.resultWithCustomProperties.members[1].objectId == 'User-1-Object-Id'",
+ "not(exists(conversation.resultWithCustomProperties.members[2]))"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembersError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembersError.test.dialog
new file mode 100644
index 0000000000..2f2f705eb2
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembersError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetPagedMembers",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetPagedMembers works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog
new file mode 100644
index 0000000000..559b99576c
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog
@@ -0,0 +1,65 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetPagedTeamMembers",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetPagedTeamMembers",
+ "property": "conversation.resultWithCustomProperties",
+ "continuationToken": "token",
+ "pageSize": 2
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "team": {
+ "id": "team-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.continuationToken == 'token'",
+ "conversation.result.members[0].email == 'User.0@microsoft.com'",
+ "conversation.result.members[0].id == '29:User-Id-0'",
+ "conversation.result.members[0].objectId == 'User-0-Object-Id'",
+ "conversation.result.members[1].email == 'User.1@microsoft.com'",
+ "conversation.result.members[1].id == '29:User-Id-1'",
+ "conversation.result.members[1].objectId == 'User-1-Object-Id'",
+ "conversation.result.members[2].email == 'User.2@microsoft.com'",
+ "conversation.result.members[2].id == '29:User-Id-2'",
+ "conversation.result.members[2].objectId == 'User-2-Object-Id'",
+ "conversation.resultWithCustomProperties.continuationToken == 'customToken'",
+ "conversation.resultWithCustomProperties.members[0].email == 'User.0@microsoft.com'",
+ "conversation.resultWithCustomProperties.members[0].id == '29:User-Id-0'",
+ "conversation.resultWithCustomProperties.members[0].objectId == 'User-0-Object-Id'",
+ "conversation.resultWithCustomProperties.members[1].email == 'User.1@microsoft.com'",
+ "conversation.resultWithCustomProperties.members[1].id == '29:User-Id-1'",
+ "conversation.resultWithCustomProperties.members[1].objectId == 'User-1-Object-Id'",
+ "not(exists(conversation.resultWithCustomProperties.members[2]))"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog
new file mode 100644
index 0000000000..f8b11b4486
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetPagedTeamMembers",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetPagedTeamMembers works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannels.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannels.test.dialog
new file mode 100644
index 0000000000..a5e4697ba9
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannels.test.dialog
@@ -0,0 +1,58 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamChannels",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetTeamChannels",
+ "property": "conversation.resultWithCustomProperties",
+ "teamId": "customTeamId"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "team": {
+ "id": "team-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result[0].id == '19:ChannelIdgeneralChannelId@thread.skype'",
+ "conversation.result[0].name == 'Testing0'",
+ "conversation.result[1].id == '19:somechannelId2e5ab3df9ae9b594bdb@thread.skype'",
+ "conversation.result[1].name == 'Testing1'",
+ "conversation.result[2].id == '19:somechannelId388ade16aa4dd375e69@thread.skype'",
+ "conversation.result[2].name == 'Testing2'",
+ "conversation.resultWithCustomProperties[0].id == '19:ChannelIdgeneralChannelId@thread.skype'",
+ "conversation.resultWithCustomProperties[0].name == 'Testing0'",
+ "conversation.resultWithCustomProperties[1].id == '19:somechannelId2e5ab3df9ae9b594bdb@thread.skype'",
+ "conversation.resultWithCustomProperties[1].name == 'Testing1'",
+ "conversation.resultWithCustomProperties[2].id == '19:somechannelId388ade16aa4dd375e69@thread.skype'",
+ "conversation.resultWithCustomProperties[2].name == 'Testing2'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannelsError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannelsError.test.dialog
new file mode 100644
index 0000000000..7d6735ab0f
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannelsError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamChannels",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetTeamChannels works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetails.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetails.test.dialog
new file mode 100644
index 0000000000..49d9f9068e
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetails.test.dialog
@@ -0,0 +1,52 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamDetails",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetTeamDetails",
+ "property": "conversation.resultWithCustomProperties",
+ "teamId": "customTeamId"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "team": {
+ "id": "team-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.aadGroupId == 'Team-aadGroupId'",
+ "conversation.result.id == '19:generalChannelIdgeneralChannelId@thread.skype'",
+ "conversation.result.name == 'TeamName'",
+ "conversation.resultWithCustomProperties.aadGroupId == 'Team-aadGroupId'",
+ "conversation.resultWithCustomProperties.id == '19:generalChannelIdgeneralChannelId@thread.skype'",
+ "conversation.resultWithCustomProperties.name == 'TeamName'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetailsError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetailsError.test.dialog
new file mode 100644
index 0000000000..a501cfdbef
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetailsError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamDetails",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetTeamDetails works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMember.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMember.test.dialog
new file mode 100644
index 0000000000..4a45b57cf6
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMember.test.dialog
@@ -0,0 +1,64 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "enableTrace": true,
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamMember",
+ "property": "conversation.result"
+ },
+ {
+ "$kind": "Teams.GetTeamMember",
+ "property": "conversation.resultWithCustomProperties",
+ "memberId": "customMemberId",
+ "teamId": "customTeamId"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "channelData": {
+ "tenant": {
+ "id": "tenant-id-1"
+ },
+ "team": {
+ "id": "team-id-1"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.email == 'User.0@microsoft.com'",
+ "conversation.result.givenName == 'User'",
+ "conversation.result.id == '29:User-Id-0'",
+ "conversation.result.name == 'User Name-0'",
+ "conversation.result.objectId == 'User-0-Object-Id'",
+ "conversation.result.surname == 'Surname-0'",
+ "conversation.result.tenantId == 'tenant-id-1'",
+ "conversation.result.userPrincipalName == 'user0@microsoft.com'",
+ "conversation.resultWithCustomProperties.email == 'User.0@microsoft.com'",
+ "conversation.resultWithCustomProperties.givenName == 'User'",
+ "conversation.resultWithCustomProperties.id == '29:User-Id-0'",
+ "conversation.resultWithCustomProperties.name == 'User Name-0'",
+ "conversation.resultWithCustomProperties.objectId == 'User-0-Object-Id'",
+ "conversation.resultWithCustomProperties.surname == 'Surname-0'",
+ "conversation.resultWithCustomProperties.tenantId == 'tenant-id-1'",
+ "conversation.resultWithCustomProperties.userPrincipalName == 'user0@microsoft.com'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberError.test.dialog
new file mode 100644
index 0000000000..6f97c8bc51
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamMember",
+ "property": "$result"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.GetTeamMember works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog
new file mode 100644
index 0000000000..ad843a82c7
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog
@@ -0,0 +1,43 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.GetTeamMember",
+ "property": "$result",
+ "memberId": "=turn.activity.channelData.doesNotExist"
+ },
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${$result}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Missing MemberId in Teams.GetTeamMember."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog
new file mode 100644
index 0000000000..188d548469
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog
@@ -0,0 +1,50 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendAppBasedLinkQueryResponse",
+ "card": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.thumbnail",
+ "content": {
+ "title": "card-title"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendAppBasedLinkQueryResponse'",
+ "value.body.composeExtension.attachmentLayout == 'list'",
+ "value.body.composeExtension.type == 'result'",
+ "value.body.composeExtension.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'",
+ "value.body.composeExtension.attachments[0].content.title == 'card-title'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog
new file mode 100644
index 0000000000..2323a1cb05
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog
@@ -0,0 +1,79 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoCard",
+ "pattern": "NoCard"
+ },
+ {
+ "intent": "NoAttachments",
+ "pattern": "NoAttachments"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoCard",
+ "actions": [
+ {
+ "$kind": "Teams.SendAppBasedLinkQueryResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendAppBasedLinkQueryResponse",
+ "card": {
+ "type": "message"
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoCard",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "An activity with attachments is required for Teams.SendAppBasedLinkQueryResponse."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoAttachments",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Invalid activity. An attachment is required for Teams.SendAppBasedLinkQueryResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponse.test.dialog
new file mode 100644
index 0000000000..4f83b08266
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponse.test.dialog
@@ -0,0 +1,56 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEActionResponse",
+ "title": "some title",
+ "height": 1,
+ "width": 2,
+ "completionBotId": "someBotId",
+ "card": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.thumbnail",
+ "content": {
+ "title": "card-title"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMEActionResponse'",
+ "value.body.task.value.completionBotId == 'someBotId'",
+ "value.body.task.value.height == 1",
+ "value.body.task.value.title == 'some title'",
+ "value.body.task.value.width == 2",
+ "value.body.task.value.card.contentType == 'application/vnd.microsoft.card.thumbnail'",
+ "value.body.task.value.card.content.title == 'card-title'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponseError.test.dialog
new file mode 100644
index 0000000000..8fd4f9bb21
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponseError.test.dialog
@@ -0,0 +1,54 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoAttachments",
+ "pattern": "NoAttachments"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEActionResponse",
+ "card": {
+ "type": "message"
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoAttachments",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Missing attachments in Teams.SendMEActionResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog
new file mode 100644
index 0000000000..5ae8adb325
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog
@@ -0,0 +1,50 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAttachmentsResponse",
+ "attachments": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.thumbnail",
+ "content": {
+ "title": "card-title"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMEAttachmentsResponse'",
+ "value.body.composeExtension.attachmentLayout == 'list'",
+ "value.body.composeExtension.type == 'result'",
+ "value.body.composeExtension.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'",
+ "value.body.composeExtension.attachments[0].content.title == 'card-title'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog
new file mode 100644
index 0000000000..ed4f18b0b0
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog
@@ -0,0 +1,44 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAttachmentsResponse",
+ "attachments": {
+ "type": "message"
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Missing attachments in Teams.SendMEAttachmentsResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponse.test.dialog
new file mode 100644
index 0000000000..6acfa74080
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponse.test.dialog
@@ -0,0 +1,41 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAuthResponse",
+ "connectionName": "testConnection",
+ "title": "test title"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMEAuthResponse'",
+ "value.body.composeExtension.type == 'auth'",
+ "value.body.composeExtension.suggestedActions.actions[0].title == 'test title'",
+ "value.body.composeExtension.suggestedActions.actions[0].type == 'openUrl'",
+ "startsWith(value.body.composeExtension.suggestedActions.actions[0].value, 'https://fake.com/oauthsignin/testConnection')"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog
new file mode 100644
index 0000000000..b860a92226
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog
@@ -0,0 +1,43 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAuthResponse",
+ "connectionName": "someConnection",
+ "title": "someTitle"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoConnectionName",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.SendMEAuthResponse: not supported by the current adapter."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog
new file mode 100644
index 0000000000..7d7425ba9b
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog
@@ -0,0 +1,88 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoConnectionName",
+ "pattern": "NoConnectionName"
+ },
+ {
+ "intent": "NoTitle",
+ "pattern": "NoTitle"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoConnectionName",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAuthResponse",
+ "connectionName": "=turn.channelData.DoesNotExist"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoTitle",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAuthResponse",
+ "connectionName": "testConnection",
+ "title": "=turn.channelData.doesNotExist"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEAuthResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoConnectionName",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid ConnectionName is required for auth responses."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoTitle",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid Title is required for auth responses."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog
new file mode 100644
index 0000000000..74343b9138
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog
@@ -0,0 +1,52 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEBotMessagePreviewResponse",
+ "card": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.thumbnail",
+ "content": {
+ "title": "card-title"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMEBotMessagePreviewResponse'",
+ "value.body.composeExtension.type == 'botMessagePreview'",
+ "value.body.composeExtension.activityPreview.attachmentLayout == 'list'",
+ "value.body.composeExtension.activityPreview.inputHint == 'acceptingInput'",
+ "value.body.composeExtension.activityPreview.type == 'message'",
+ "value.body.composeExtension.activityPreview.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'",
+ "value.body.composeExtension.activityPreview.attachments[0].content.title == 'card-title'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog
new file mode 100644
index 0000000000..3ef5fd3bac
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog
@@ -0,0 +1,79 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoCard",
+ "pattern": "NoCard"
+ },
+ {
+ "intent": "NoAttachments",
+ "pattern": "NoAttachments"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoCard",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEBotMessagePreviewResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEBotMessagePreviewResponse",
+ "card": {
+ "type": "message"
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoCard",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid Card is required for Teams.SendMEBotMessagePreviewResponse."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoAttachments",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Invalid activity. An attachment is required for Teams.SendMEBotMessagePreviewResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog
new file mode 100644
index 0000000000..65d8447602
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog
@@ -0,0 +1,39 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEConfigQuerySettingUrlResponse",
+ "configUrl": "someBaseUrl.com/somePage.html"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMEConfigQuerySettingUrlResponse'",
+ "value.body.composeExtension.type == 'config'",
+ "value.body.composeExtension.suggestedActions.actions[0].type == 'openUrl'",
+ "value.body.composeExtension.suggestedActions.actions[0].value == 'someBaseUrl.com/somePage.html'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog
new file mode 100644
index 0000000000..6245df449d
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog
@@ -0,0 +1,32 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEConfigQuerySettingUrlResponse"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "ConfigUrl is required for Teams.SendMEConfigQuerySettingUrlResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponse.test.dialog
new file mode 100644
index 0000000000..0efa1dfde0
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponse.test.dialog
@@ -0,0 +1,38 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEMessageResponse",
+ "message": "i want to send this to the user"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMEMessageResponse'",
+ "value.body.composeExtension.type == 'message'",
+ "value.body.composeExtension.text == 'i want to send this to the user'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog
new file mode 100644
index 0000000000..6f4f595c4b
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog
@@ -0,0 +1,32 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMEMessageResponse"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A Message is required for Teams.SendMEMessageResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog
new file mode 100644
index 0000000000..b9a8f8ddb2
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog
@@ -0,0 +1,50 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMESelectItemResponse",
+ "card": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.thumbnail",
+ "content": {
+ "title": "card-title"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendMESelectItemResponse'",
+ "value.body.composeExtension.type == 'result'",
+ "value.body.composeExtension.attachmentLayout == 'list'",
+ "value.body.composeExtension.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'",
+ "value.body.composeExtension.attachments[0].content.title == 'card-title'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog
new file mode 100644
index 0000000000..a78eb61c61
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog
@@ -0,0 +1,79 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoCard",
+ "pattern": "NoCard"
+ },
+ {
+ "intent": "NoAttachments",
+ "pattern": "NoAttachments"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoCard",
+ "actions": [
+ {
+ "$kind": "Teams.SendMESelectItemResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendMESelectItemResponse",
+ "card": {
+ "type": "message"
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoCard",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid card is required for Teams.SendMESelectItemResponse."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoAttachments",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Invalid activity. An attachment is required for Teams.SendMESelectItemResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog
new file mode 100644
index 0000000000..6996effedb
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog
@@ -0,0 +1,63 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMessageToTeamsChannel",
+ "conversationReferenceProperty": "conversation.result",
+ "activity": {
+ "type": "message",
+ "text": "This is a message to a Teams Channel"
+ }
+ },
+ {
+ "$kind": "Teams.SendMessageToTeamsChannel",
+ "conversationReferenceProperty": "conversation.resultWithCustomProperties",
+ "activity": {
+ "type": "message",
+ "text": "This is a message to a Teams Channel with custom properties"
+ },
+ "teamsChannelId": "customTeamsChannel"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "channelData": {
+ "channel": {
+ "id": "fakeTeamsChannelToSendTo"
+ }
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.MemoryAssertions",
+ "assertions": [
+ "conversation.result.activityId == '0'",
+ "conversation.result.channelId == 'msteams'",
+ "conversation.result.conversation.conversationType == 'groupChat'",
+ "conversation.result.conversation.isGroup == true",
+ "conversation.result.conversation.name == 'group'",
+ "conversation.result.conversation.tenantId == 'tenantId-Guid'",
+ "conversation.resultWithCustomProperties.activityId == '0'",
+ "conversation.resultWithCustomProperties.channelId == 'msteams'",
+ "conversation.resultWithCustomProperties.conversation.conversationType == 'groupChat'",
+ "conversation.resultWithCustomProperties.conversation.isGroup == true",
+ "conversation.resultWithCustomProperties.conversation.name == 'group'",
+ "conversation.resultWithCustomProperties.conversation.tenantId == 'tenantId-Guid'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog
new file mode 100644
index 0000000000..19419f3b1c
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog
@@ -0,0 +1,37 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendMessageToTeamsChannel"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserSays",
+ "text": "hi"
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.SendMessageToTeamsChannel works only on the Teams channel."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog
new file mode 100644
index 0000000000..b5e40d7263
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog
@@ -0,0 +1,43 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabAuthResponse",
+ "connectionName": "someConnection",
+ "title": "someTitle"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoConnectionName",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Teams.SendTabAuthResponse: not supported by the current adapter."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog
new file mode 100644
index 0000000000..8172f1d27c
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog
@@ -0,0 +1,88 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoConnectionName",
+ "pattern": "NoConnectionName"
+ },
+ {
+ "intent": "NoTitle",
+ "pattern": "NoTitle"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoConnectionName",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabAuthResponse",
+ "connectionName": "=turn.channelData.DoesNotExist"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoTitle",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabAuthResponse",
+ "connectionName": "testConnection",
+ "title": "=turn.channelData.doesNotExist"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabAuthResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoConnectionName",
+ "name": "tab/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid ConnectionName is required for auth responses."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoTitle",
+ "name": "tab/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid Title is required for auth responses."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponse.test.dialog
new file mode 100644
index 0000000000..7e06e3ecde
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponse.test.dialog
@@ -0,0 +1,66 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabCardResponse",
+ "cards": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.adaptive",
+ "content": {
+ "type": "AdaptiveCard",
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.2",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "RichTextBlock",
+ "inlines": [
+ {
+ "type": "TextRun",
+ "text": "Success!"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "tab/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendTabCardResponse'",
+ "value.body.tab.type == 'continue'",
+ "value.body.tab.value.cards[0].card.body[0].items[0].inlines[0].text == 'Success!'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponseError.test.dialog
new file mode 100644
index 0000000000..1e8a6bdc8c
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponseError.test.dialog
@@ -0,0 +1,79 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoCard",
+ "pattern": "NoCard"
+ },
+ {
+ "intent": "NoAttachments",
+ "pattern": "NoAttachments"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoCard",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabCardResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendTabCardResponse",
+ "cards": {
+
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoCard",
+ "name": "tab/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Valid Cards are required for Teams.SendTabCardResponse."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoAttachments",
+ "name": "tab/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Invalid activity. Attachment(s) are required for Teams.SendTabCardResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog
new file mode 100644
index 0000000000..d3c0c285fd
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog
@@ -0,0 +1,56 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendTaskModuleCardResponse",
+ "title": "some title",
+ "height": 1,
+ "width": 2,
+ "completionBotId": "someBotId",
+ "card": {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.thumbnail",
+ "content": {
+ "title": "card-title"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendTaskModuleCardResponse'",
+ "value.body.task.value.completionBotId == 'someBotId'",
+ "value.body.task.value.height == 1",
+ "value.body.task.value.title == 'some title'",
+ "value.body.task.value.width == 2",
+ "value.body.task.value.card.contentType == 'application/vnd.microsoft.card.thumbnail'",
+ "value.body.task.value.card.content.title == 'card-title'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog
new file mode 100644
index 0000000000..20e353e108
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog
@@ -0,0 +1,79 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "recognizer": {
+ "$kind": "Microsoft.RegexRecognizer",
+ "intents": [
+ {
+ "intent": "NoCard",
+ "pattern": "NoCard"
+ },
+ {
+ "intent": "NoAttachments",
+ "pattern": "NoAttachments"
+ }
+ ]
+ },
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoCard",
+ "actions": [
+ {
+ "$kind": "Teams.SendTaskModuleCardResponse"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnIntent",
+ "intent": "NoAttachments",
+ "actions": [
+ {
+ "$kind": "Teams.SendTaskModuleCardResponse",
+ "card": {
+ "type": "message"
+ }
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoCard",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "A valid Card is required for Teams.SendTaskModuleCardResponse."
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "NoAttachments",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Invalid activity. An attachment is required for Teams.SendTaskModuleCardResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog
new file mode 100644
index 0000000000..5819cd6331
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog
@@ -0,0 +1,37 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendTaskModuleMessageResponse",
+ "message": "i want to send this to the user"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendTaskModuleMessageResponse'",
+ "value.body.task.value == 'i want to send this to the user'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog
new file mode 100644
index 0000000000..53a2d07eac
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog
@@ -0,0 +1,47 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendTaskModuleUrlResponse",
+ "title": "some title",
+ "height": 1,
+ "width": 2,
+ "completionBotId": "someBotId",
+ "url": "http://thisIsTheMainUrl.com",
+ "fallbackUrl": "http://thisIsTheFallbackUrl.net/okay/falling/back_now"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReplyActivity",
+ "assertions": [
+ "type == 'invokeResponse'",
+ "conversation.id == 'Action_SendTaskModuleUrlResponse'",
+ "value.body.task.value.completionBotId == 'someBotId'",
+ "value.body.task.value.height == 1",
+ "value.body.task.value.title == 'some title'",
+ "value.body.task.value.width == 2",
+ "value.body.task.value.url == 'http://thisIsTheMainUrl.com'",
+ "value.body.task.value.fallbackUrl == 'http://thisIsTheFallbackUrl.net/okay/falling/back_now'"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog
new file mode 100644
index 0000000000..e30217656b
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog
@@ -0,0 +1,42 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnUnknownIntent",
+ "actions": [
+ {
+ "$kind": "Teams.SendTaskModuleUrlResponse",
+ "url": "=turn.channelData.doesNotExist"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnError",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.dialogEvent.value.message}"
+ }
+ ]
+ }
+ ]
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "message",
+ "text": "hi",
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "Missing Url for Teams.SendTaskModuleUrlResponse."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog b/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog
new file mode 100644
index 0000000000..ef348c61ac
--- /dev/null
+++ b/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog
@@ -0,0 +1,616 @@
+{
+ "$schema": "../../../tests.schema",
+ "$kind": "Microsoft.Test.Script",
+ "dialog": {
+ "$kind": "Microsoft.AdaptiveDialog",
+ "id": "planningTest",
+ "triggers": [
+ {
+ "$kind": "Microsoft.OnInvokeActivity",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.activity.text}"
+ }
+ ]
+ },
+ {
+ "$kind": "Microsoft.OnConversationUpdateActivity",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "${turn.activity.text}"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnAppBasedLinkQuery",
+ "condition": "turn.activity.text == 'OnAppBasedLinkQuery'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnAppBasedLinkQuery"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnCardAction",
+ "condition": "turn.activity.text == 'OnCardAction'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnCardAction"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnChannelCreated",
+ "condition": "turn.activity.text == 'OnChannelCreated'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnChannelCreated"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnChannelDeleted",
+ "condition": "turn.activity.text == 'OnChannelDeleted'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnChannelDeleted"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnChannelRenamed",
+ "condition": "turn.activity.text == 'OnChannelRenamed'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnChannelRenamed"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnChannelRestored",
+ "condition": "turn.activity.text == 'OnChannelRestored'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnChannelRestored"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnFileConsent",
+ "condition": "turn.activity.text == 'OnFileConsent'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnFileConsent"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMECardButtonClicked",
+ "condition": "turn.activity.text == 'OnCardButtonClicked'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnCardButtonClicked"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMEConfigQuerySettingUrl",
+ "condition": "turn.activity.text == 'OnConfigurationQuerySettingUrl'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnConfigurationQuerySettingUrl"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMEConfigSetting",
+ "condition": "turn.activity.text == 'OnConfigurationSetting'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnConfigurationSetting"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMEFetchTask",
+ "condition": "turn.activity.text == 'OnFetchTask'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnFetchTask"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMEQuery",
+ "condition": "turn.activity.text == 'OnQuery'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnQuery"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMESelectItem",
+ "condition": "turn.activity.text == 'OnSelectItem'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnSelectItem"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnMESubmitAction",
+ "condition": "turn.activity.text == 'OnSubmitAction'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnSubmitAction"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnO365ConnectorCardAction",
+ "condition": "turn.activity.text == 'OnO365ConnectorCardAction'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnO365ConnectorCardAction"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTaskModuleFetch",
+ "condition": "turn.activity.text == 'OnTaskModuleFetch'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTaskModuleFetch"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTabFetch",
+ "condition": "turn.activity.text == 'OnTabFetch'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTabFetch"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTaskModuleSubmit",
+ "condition": "turn.activity.text == 'OnTaskModuleSubmit'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTaskModuleSubmit"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTabSubmit",
+ "condition": "turn.activity.text == 'OnTabSubmit'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTabSubmit"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTeamArchived",
+ "condition": "turn.activity.text == 'OnTeamArchived'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTeamArchived"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTeamDeleted",
+ "condition": "turn.activity.text == 'OnTeamDeleted'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTeamDeleted"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTeamHardDeleted",
+ "condition": "turn.activity.text == 'OnTeamHardDeleted'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTeamHardDeleted"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTeamRenamed",
+ "condition": "turn.activity.text == 'OnTeamRenamed'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTeamRenamed"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTeamRestored",
+ "condition": "turn.activity.text == 'OnTeamRestored'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTeamRestored"
+ }
+ ]
+ },
+ {
+ "$kind": "Teams.OnTeamUnarchived",
+ "condition": "turn.activity.text == 'OnTeamUnarchived'",
+ "actions": [
+ {
+ "$kind": "Microsoft.SendActivity",
+ "activity": "OnTeamUnarchived"
+ }
+ ]
+ }
+ ],
+ "autoEndDialog": false,
+ "defaultResultProperty": "dialog.result"
+ },
+ "script": [
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnAppBasedLinkQuery",
+ "value": {},
+ "name": "composeExtension/queryLink"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnAppBasedLinkQuery"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnCardAction",
+ "value": {}
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnCardAction"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnChannelCreated",
+ "channelData": {
+ "eventType": "channelCreated"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnChannelCreated"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnChannelDeleted",
+ "channelData": {
+ "eventType": "channelDeleted"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnChannelDeleted"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnChannelRenamed",
+ "channelData": {
+ "eventType": "channelRenamed"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnChannelRenamed"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnChannelRestored",
+ "channelData": {
+ "eventType": "channelRestored"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnChannelRestored"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnFileConsent",
+ "value": {},
+ "name": "fileConsent/invoke"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnFileConsent"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnCardButtonClicked",
+ "value": {},
+ "name": "composeExtension/onCardButtonClicked"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnCardButtonClicked"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnConfigurationQuerySettingUrl",
+ "value": {},
+ "name": "composeExtension/querySettingUrl"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnConfigurationQuerySettingUrl"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnConfigurationSetting",
+ "value": {},
+ "name": "composeExtension/setting"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnConfigurationSetting"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnFetchTask",
+ "value": {},
+ "name": "composeExtension/fetchTask"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnFetchTask"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnQuery",
+ "value": {},
+ "name": "composeExtension/query"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnQuery"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnSelectItem",
+ "value": {},
+ "name": "composeExtension/selectItem"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnSelectItem"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnSubmitAction",
+ "value": {},
+ "name": "composeExtension/submitAction"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnSubmitAction"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnO365ConnectorCardAction",
+ "value": {},
+ "name": "actionableMessage/executeAction"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnO365ConnectorCardAction"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnTabFetch",
+ "value": {},
+ "name": "tab/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTabFetch"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnTaskModuleFetch",
+ "value": {},
+ "name": "task/fetch"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTaskModuleFetch"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnTabSubmit",
+ "value": {},
+ "name": "tab/submit"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTabSubmit"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "invoke",
+ "text": "OnTaskModuleSubmit",
+ "value": {},
+ "name": "task/submit"
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTaskModuleSubmit"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnTeamArchived",
+ "channelData": {
+ "eventType": "teamArchived"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTeamArchived"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnTeamDeleted",
+ "channelData": {
+ "eventType": "teamDeleted"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTeamDeleted"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnTeamHardDeleted",
+ "channelData": {
+ "eventType": "teamHardDeleted"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTeamHardDeleted"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnTeamRenamed",
+ "channelData": {
+ "eventType": "teamRenamed"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTeamRenamed"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnTeamRestored",
+ "channelData": {
+ "eventType": "teamRestored"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTeamRestored"
+ },
+ {
+ "$kind": "Microsoft.Test.UserActivity",
+ "activity": {
+ "type": "conversationUpdate",
+ "text": "OnTeamUnarchived",
+ "channelData": {
+ "eventType": "teamUnarchived"
+ }
+ }
+ },
+ {
+ "$kind": "Microsoft.Test.AssertReply",
+ "text": "OnTeamUnarchived"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/unit/packages/Teams/dotnet/ActionTests.cs b/tests/unit/packages/Teams/dotnet/ActionTests.cs
new file mode 100644
index 0000000000..c4f5ff73f7
--- /dev/null
+++ b/tests/unit/packages/Teams/dotnet/ActionTests.cs
@@ -0,0 +1,592 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Bot.Builder;
+using Microsoft.Bot.Builder.Dialogs;
+using Microsoft.Bot.Builder.Dialogs.Adaptive;
+using Microsoft.Bot.Builder.Dialogs.Adaptive.Testing;
+using Microsoft.Bot.Builder.Dialogs.Declarative;
+using Microsoft.Bot.Builder.Dialogs.Declarative.Obsolete;
+using Microsoft.Bot.Connector;
+using Microsoft.Bot.Connector.Authentication;
+using Microsoft.Bot.Schema;
+using Microsoft.Bot.Schema.Teams;
+using Newtonsoft.Json.Linq;
+using Xunit;
+
+namespace Microsoft.Bot.Components.Teams.Tests
+{
+ [CollectionDefinition("Dialogs.Adaptive")]
+ public class ActionTests : IClassFixture
+ {
+ private readonly ResourceExplorerFixture _resourceExplorerFixture;
+
+ public ActionTests(ResourceExplorerFixture resourceExplorerFixture)
+ {
+ ComponentRegistration.Add(new DeclarativeComponentRegistration());
+ ComponentRegistration.Add(new DialogsComponentRegistration());
+ ComponentRegistration.Add(new AdaptiveComponentRegistration());
+ ComponentRegistration.Add(new LanguageGenerationComponentRegistration());
+ ComponentRegistration.Add(new AdaptiveTestingComponentRegistration());
+ ComponentRegistration.Add(new DeclarativeComponentRegistrationBridge());
+
+ _resourceExplorerFixture = resourceExplorerFixture.Initialize(nameof(ActionTests));
+ }
+
+ [Fact]
+ public async Task Action_GetMeetingParticipant()
+ {
+ var participantResult = GetParticipant().ToString();
+
+ var uriToContent = new Dictionary()
+ {
+ { "/v1/meetings/meeting-id-1/participants/participant-aad-id-1?tenantId=tenant-id-1", participantResult },
+ { "/v1/meetings/customMeetingId/participants/customParticipantId?tenantId=customTenantId", participantResult }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetMeetingParticipantError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetMeetingParticipantErrorWithAdapter()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_GetMember()
+ {
+ var participantResult = GetParticipant().ToString();
+ var uriToContent = new Dictionary()
+ {
+ { "/v3/conversations/Action_GetMember/members/member-id", participantResult },
+ { "/v3/conversations/Action_GetMember/members/customMemberId", participantResult }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetMemberError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetMemberErrorWithAdapter()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_GetPagedMembers()
+ {
+ var threeMembers = GenerateTeamMembers(3);
+ threeMembers.ContinuationToken = "customToken";
+
+ var twoMembers = GenerateTeamMembers(2);
+ twoMembers.ContinuationToken = "token";
+
+ var uriToContent = new Dictionary()
+ {
+ { "/v3/conversations/Action_GetPagedMembers/pagedmembers", JObject.FromObject(threeMembers).ToString() },
+ { "/v3/conversations/Action_GetPagedMembers/pagedmembers?pageSize=2&continuationToken=token", JObject.FromObject(twoMembers).ToString() }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetPagedMembersError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetPagedTeamMembers()
+ {
+ var threeMembers = GenerateTeamMembers(3);
+ threeMembers.ContinuationToken = "token";
+
+ var twoMembers = GenerateTeamMembers(2);
+ twoMembers.ContinuationToken = "token";
+
+ var uriToContent = new Dictionary()
+ {
+ { "/v3/conversations/team-id-1/pagedmembers", JObject.FromObject(threeMembers).ToString() },
+ { "/v3/conversations/team-id-1/pagedmembers?pageSize=2&continuationToken=token", JObject.FromObject(twoMembers).ToString() }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetPagedTeamMembersError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetTeamChannels()
+ {
+ var conversations = JObject.FromObject(new ConversationList
+ {
+ Conversations = new List()
+ {
+ new ChannelInfo { Id = "19:ChannelIdgeneralChannelId@thread.skype", Name = "Testing0" },
+ new ChannelInfo { Id = "19:somechannelId2e5ab3df9ae9b594bdb@thread.skype", Name = "Testing1" },
+ new ChannelInfo { Id = "19:somechannelId388ade16aa4dd375e69@thread.skype", Name = "Testing2" },
+ }
+ }).ToString();
+
+ var uriToContent = new Dictionary()
+ {
+ { "/v3/teams/team-id-1/conversations", conversations },
+ { "/v3/teams/customTeamId/conversations", conversations }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetTeamChannelsError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetTeamDetails()
+ {
+ var details = JObject.FromObject(new TeamDetails
+ {
+ Id = "19:generalChannelIdgeneralChannelId@thread.skype",
+ Name = "TeamName",
+ AadGroupId = "Team-aadGroupId"
+ }).ToString();
+
+ var uriToContent = new Dictionary()
+ {
+ { "/v3/teams/team-id-1/team-id-1", details },
+ { "/v3/teams/customTeamId", details }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetTeamDetailsError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetTeamMember()
+ {
+ var member = JObject.FromObject(GenerateTeamMembers(1).Members.First()).ToString();
+
+ var uriToContent = new Dictionary()
+ {
+ { "/v3/conversations/team-id-1/members/user1", member },
+ { "/v3/conversations/customTeamId/members/customMemberId", member }
+ };
+
+ var teamsMiddleware = GetTeamsMiddleware(uriToContent);
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ }
+
+ [Fact]
+ public async Task Action_GetTeamMemberError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_GetTeamMemberErrorWithAdapter()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendAppBasedLinkQueryResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendAppBasedLinkQueryResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ //[Fact]
+ //public async Task Action_SendMessageToTeamsChannel()
+ //{
+ // NOTE: Current test adapter is not a BotFrameworkAdapter,
+ // and does not support mocking SendMessageToTeamsChannel
+ // var teamsMiddleware = GetTeamsMiddleware(new JObject(), "/v3/conversations");
+ // await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware });
+ //}
+
+ [Fact]
+ public async Task Action_SendMessageToTeamsChannelError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendMEActionResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMEActionResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMEAttachmentsResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMEAttachmentsResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendMEAuthResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ //[Fact]
+ //public async Task Action_SendMEAuthResponseError()
+ //{
+ // NOTE: Current test adapter is not a BotFrameworkAdapter,
+ // await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ //}
+
+ [Fact]
+ public async Task Action_SendMEAuthResponseErrorWithAdapter()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendMEBotMessagePreviewResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMEBotMessagePreviewResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendMEConfigQuerySettingUrlResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMEConfigQuerySettingUrlResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendMEMessageResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMEMessageResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendMESelectItemResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendMESelectItemResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendTaskModuleCardResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendTaskModuleCardResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test);
+ }
+
+ [Fact]
+ public async Task Action_SendTaskModuleMessageResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendTaskModuleUrlResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendTaskModuleUrlResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendTabCardResponseError()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendTabCardResponse()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ [Fact]
+ public async Task Action_SendTabAuthResponseErrorWithAdapter()
+ {
+ await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ }
+
+ //[Fact]
+ //public async Task Action_SendTabAuthResponseError()
+ //{
+ // NOTE: Current test adapter is not a BotFrameworkAdapter,
+ // await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer);
+ //}
+
+ private IMiddleware GetErrorTeamsMiddleware(string exception)
+ {
+ // Create a connector client, setup with a custom httpclient which will
+ // throw an exception when the connectorclient's outgoing pipeline's SendAsync
+ // is called
+ var messageHandler = new ErrorHttpMessageHandler(exception);
+ return GetTestConnectorClientMiddleware(messageHandler);
+ }
+
+ private ConversationReference GetGroupConversation()
+ {
+ return new ConversationReference
+ {
+ ChannelId = Channels.Msteams,
+ User = new ChannelAccount
+ {
+ Id = "29:User-Id",
+ Name = "User Name",
+ AadObjectId = "participant-aad-id"
+ },
+ Conversation = new ConversationAccount
+ {
+ ConversationType = "groupChat",
+ TenantId = "tenantId-Guid",
+ Name = "group",
+ IsGroup = true,
+ Id = "19:groupChatId@thread.v2"
+ }
+ };
+ }
+
+ private TeamsPagedMembersResult GenerateTeamMembers(int total)
+ {
+ var accounts = new List();
+
+ for (int count = 0; count < total; count++)
+ {
+ accounts.Add(new TeamsChannelAccount
+ {
+ Id = $"29:User-Id-{count}",
+ Name = $"User Name-{count}",
+ AadObjectId = $"User-{count}-Object-Id",
+ Surname = $"Surname-{count}",
+ Email = $"User.{count}@microsoft.com",
+ UserPrincipalName = $"user{count}@microsoft.com",
+ TenantId = "tenant-id-1",
+ GivenName = "User"
+ });
+ }
+
+ return new TeamsPagedMembersResult() { Members = accounts };
+ }
+
+ private JObject GetParticipant(bool groupConversation = false)
+ {
+ return JObject.FromObject(new
+ {
+ id = "29:User-Id-0",
+ objectId = "User-0-Object-Id",
+ name = "User Name-0",
+ meeting = new { role = "Organizer" },
+ surname = "Surname-0",
+ tenantId = "tenant-id-1",
+ userPrincipalName = "user0@microsoft.com",
+ user = new
+ {
+ userPrincipalName = "userPrincipalName-1",
+ },
+ email = "User.0@microsoft.com",
+ givenName = "User",
+ conversation = new
+ {
+ id = groupConversation ? "19:groupChatId@thread.v2" : "a:oneOnOneConversationId",
+ name = groupConversation ? "group" : "oneOnOne",
+ tenantId = "tenantId-Guid",
+ conversationType = groupConversation ? "groupChat" : "personal",
+ isGroup = groupConversation,
+ }
+ });
+ }
+
+ private IMiddleware GetTeamsMiddleware(JObject result, string path = null)
+ {
+ // Create a connector client, setup with a custom httpclient which will return
+ // the desired result through the TestHttpMessageHandler.
+ TestsHttpMessageHandler messageHandler;
+ if (!string.IsNullOrEmpty(path))
+ {
+ messageHandler = new TestsHttpMessageHandler(path, result.ToString());
+ }
+ else
+ {
+ messageHandler = new TestsHttpMessageHandler(result.ToString());
+ }
+
+ return GetTestConnectorClientMiddleware(messageHandler);
+ }
+
+ private IMiddleware GetTeamsMiddleware(Dictionary results)
+ {
+ // Create a connector client, setup with a custom httpclient which will return
+ // the desired result through the TestHttpMessageHandler.
+ var messageHandler = new TestsHttpMessageHandler(results);
+ return GetTestConnectorClientMiddleware(messageHandler);
+ }
+
+ private TestConnectorClientMiddleware GetTestConnectorClientMiddleware(HttpMessageHandler messageHandler)
+ {
+ var testHttpClient = new HttpClient(messageHandler);
+ testHttpClient.BaseAddress = new Uri("https://localhost.coffee");
+ var testConnectorClient = new ConnectorClient(new Uri("http://localhost.coffee/"), new MicrosoftAppCredentials(string.Empty, string.Empty), testHttpClient);
+ return new TestConnectorClientMiddleware(testConnectorClient);
+ }
+
+ // This middleware sets the turnstate's connector client,
+ // so it will be found by the adapter, and a new one not created.
+ private class TestConnectorClientMiddleware : IMiddleware
+ {
+ private IConnectorClient _connectorClient;
+
+ public TestConnectorClientMiddleware(IConnectorClient connectorClient)
+ {
+ _connectorClient = connectorClient;
+ }
+
+ public Task OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken = default)
+ {
+ turnContext.TurnState.Add(_connectorClient);
+ return next(cancellationToken);
+ }
+ }
+
+ private class ErrorHttpMessageHandler : HttpMessageHandler
+ {
+ private readonly string _error;
+
+ public ErrorHttpMessageHandler(string error)
+ {
+ _error = error;
+ }
+
+ protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ throw new Exception(_error);
+ }
+ }
+
+ // Message handler to mock returning a specific object when requested from a specified path.
+ private class TestsHttpMessageHandler : HttpMessageHandler
+ {
+ private Dictionary _uriToContent;
+ private string _content;
+
+ public TestsHttpMessageHandler(string url, string content)
+ : this(new Dictionary() { { url, content } })
+ {
+ }
+
+ public TestsHttpMessageHandler(string content)
+ {
+ _content = content;
+ }
+
+ public TestsHttpMessageHandler(Dictionary uriToContent)
+ {
+ _uriToContent = uriToContent;
+ }
+
+ protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ var response = new HttpResponseMessage(HttpStatusCode.OK);
+ if (!string.IsNullOrEmpty(_content))
+ {
+ response.Content = new StringContent(_content);
+ }
+ else
+ {
+ var path = request.RequestUri.PathAndQuery;
+ foreach (var urlAndContent in _uriToContent)
+ {
+ if (urlAndContent.Key.Contains(path, System.StringComparison.OrdinalIgnoreCase))
+ {
+ response.Content = new StringContent(urlAndContent.Value);
+ }
+ }
+ }
+
+ return Task.FromResult(response);
+ }
+ }
+ }
+}
diff --git a/tests/unit/packages/Teams/dotnet/ConditionalTests.cs b/tests/unit/packages/Teams/dotnet/ConditionalTests.cs
new file mode 100644
index 0000000000..d9a73bdc63
--- /dev/null
+++ b/tests/unit/packages/Teams/dotnet/ConditionalTests.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.IO;
+using System.Threading.Tasks;
+using Microsoft.Bot.Builder;
+using Microsoft.Bot.Builder.Dialogs;
+using Microsoft.Bot.Builder.Dialogs.Adaptive;
+using Microsoft.Bot.Builder.Dialogs.Adaptive.Testing;
+using Microsoft.Bot.Builder.Dialogs.Declarative;
+using Microsoft.Bot.Builder.Dialogs.Declarative.Obsolete;
+using Microsoft.Bot.Builder.Dialogs.Declarative.Resources;
+using Xunit;
+
+namespace Microsoft.Bot.Components.Teams.Tests
+{
+ public class ConditionalTests
+ {
+ public ConditionalTests()
+ {
+ ComponentRegistration.Add(new DeclarativeComponentRegistration());
+ ComponentRegistration.Add(new DialogsComponentRegistration());
+ ComponentRegistration.Add(new AdaptiveComponentRegistration());
+ ComponentRegistration.Add(new LanguageGenerationComponentRegistration());
+ ComponentRegistration.Add(new AdaptiveTestingComponentRegistration());
+ ComponentRegistration.Add(new DeclarativeComponentRegistrationBridge());
+
+ ResourceExplorer = new ResourceExplorer()
+ .AddFolder(Path.Combine(TestUtils.GetProjectPath(), "..", "Shared Tests", nameof(ConditionalTests)), monitorChanges: false);
+ }
+
+ public static ResourceExplorer ResourceExplorer { get; set; }
+
+ [Fact]
+ public async Task ConditionalsTests_OnTeamsActivityTypes()
+ {
+ await TestUtils.RunTestScript(ResourceExplorer);
+ }
+ }
+}
diff --git a/tests/unit/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.Tests.csproj b/tests/unit/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.Tests.csproj
new file mode 100644
index 0000000000..8418703494
--- /dev/null
+++ b/tests/unit/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.Tests.csproj
@@ -0,0 +1,35 @@
+
+
+
+ netcoreapp2.1
+ netcoreapp3.1
+ netcoreapp2.1;netcoreapp3.1
+ false
+ Debug;Release
+ latest
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
diff --git a/tests/unit/packages/Teams/dotnet/ResourceExplorerFixture.cs b/tests/unit/packages/Teams/dotnet/ResourceExplorerFixture.cs
new file mode 100644
index 0000000000..1da40ac30a
--- /dev/null
+++ b/tests/unit/packages/Teams/dotnet/ResourceExplorerFixture.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.IO;
+using Microsoft.Bot.Builder.Dialogs.Declarative.Resources;
+
+namespace Microsoft.Bot.Components.Teams.Tests
+{
+ public class ResourceExplorerFixture : IDisposable
+ {
+ private string _folderPath = string.Empty;
+
+ public ResourceExplorerFixture()
+ {
+ ResourceExplorer = new ResourceExplorer();
+ }
+
+ public ResourceExplorer ResourceExplorer { get; private set; }
+
+ public ResourceExplorerFixture Initialize(string resourceFolder)
+ {
+ if (_folderPath.Length == 0)
+ {
+ _folderPath = Path.Combine(TestUtils.GetProjectPath(), "..", "Shared Tests", resourceFolder);
+ ResourceExplorer = ResourceExplorer.AddFolder(_folderPath, monitorChanges: false);
+ }
+
+ return this;
+ }
+
+ public void Dispose()
+ {
+ _folderPath = string.Empty;
+ ResourceExplorer.Dispose();
+ }
+ }
+}
diff --git a/tests/unit/packages/Teams/dotnet/TestUtils.cs b/tests/unit/packages/Teams/dotnet/TestUtils.cs
new file mode 100644
index 0000000000..f8f136dc1b
--- /dev/null
+++ b/tests/unit/packages/Teams/dotnet/TestUtils.cs
@@ -0,0 +1,98 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using Microsoft.Bot.Builder;
+using Microsoft.Bot.Builder.Adapters;
+using Microsoft.Bot.Builder.Dialogs.Adaptive.Testing;
+using Microsoft.Bot.Builder.Dialogs.Declarative.Resources;
+using Microsoft.Bot.Connector;
+using Microsoft.Bot.Schema;
+using Microsoft.Extensions.Configuration;
+
+namespace Microsoft.Bot.Components.Teams.Tests
+{
+ public class TestUtils
+ {
+ public static IConfiguration DefaultConfiguration { get; set; } = new ConfigurationBuilder().AddInMemoryCollection().Build();
+
+ public static string RootFolder { get; set; } = GetProjectPath();
+
+ public static IEnumerable