Skip to content

Commit

Permalink
Ensure TeamsChannelData is supplied to ChannelData (#6477)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfinytRam committed Oct 4, 2022
1 parent 6cb09dc commit ca77e6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libraries/Microsoft.Bot.Builder/Teams/TeamsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static Task<TeamsChannelAccount> GetMemberAsync(ITurnContext turnContext,
var conversationParameters = new ConversationParameters
{
IsGroup = true,
ChannelData = new { channel = new { id = teamsChannelId } },
ChannelData = new TeamsChannelData { Channel = new ChannelInfo() { Id = teamsChannelId } },
Activity = (Activity)activity,
};

Expand Down Expand Up @@ -296,7 +296,7 @@ public static Task<TeamsChannelAccount> GetMemberAsync(ITurnContext turnContext,
var conversationParameters = new ConversationParameters
{
IsGroup = true,
ChannelData = new { channel = new { id = teamsChannelId } },
ChannelData = new TeamsChannelData { Channel = new ChannelInfo() { Id = teamsChannelId } },
Activity = (Activity)activity,
};

Expand Down
10 changes: 5 additions & 5 deletions tests/Microsoft.Bot.Builder.Tests/Teams/TeamsInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task TestSendMessageToTeamsChannelAsync()

// Set a special base address so then we can make sure the connector client is honoring this http client
customHttpClient.BaseAddress = baseUri;

var connectorClient = new ConnectorClient(new Uri("https://test.coffee"), MicrosoftAppCredentials.Empty, customHttpClient);

var activity = new Activity
Expand Down Expand Up @@ -100,8 +100,8 @@ public async Task TestSendMessageToTeamsChannel2Async()

var channelData = adapter.ConversationParameters.ChannelData;

var channel = channelData.GetType().GetProperty("channel").GetValue(channelData, null);
var id = channel.GetType().GetProperty("id").GetValue(channel, null);
var channel = channelData.GetType().GetProperty("Channel").GetValue(channelData, null);
var id = channel.GetType().GetProperty("Id").GetValue(channel, null);

Assert.Equal(expectedTeamsChannelId, id);
Assert.Equal(adapter.ConversationParameters.Activity, activity);
Expand Down Expand Up @@ -509,8 +509,8 @@ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage reques
// SendMessageToThreadInTeams
else if (request.RequestUri.PathAndQuery.EndsWith("v3/conversations"))
{
var content = new JObject
{
var content = new JObject
{
new JProperty("id", "id123"),
new JProperty("serviceUrl", "https://serviceUrl/"),
new JProperty("activityId", "activityId123")
Expand Down

0 comments on commit ca77e6b

Please sign in to comment.