Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Teams] Add TeamsInfo helper class, minor fix in ConversationUpdateBot scenario #1253

Merged
merged 3 commits into from
Oct 4, 2019

Conversation

stevengum
Copy link
Member

@stevengum stevengum commented Oct 4, 2019

Fixes: #1214

Description

Adds the TeamsInfo helper class.

Testing

Tested manually, unit tests are coming next

@coveralls
Copy link

coveralls commented Oct 4, 2019

Pull Request Test Coverage Report for Build 81742

  • 3 of 36 (8.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 86.745%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder/src/teamsInfo.ts 2 35 5.71%
Totals Coverage Status
Change from base Build 81697: -0.7%
Covered Lines: 4598
Relevant Lines: 5101

💛 - Coveralls

@@ -852,7 +852,7 @@ export class BotFrameworkAdapter extends BotAdapter implements IUserTokenProvide
* @remarks
* Override this in a derived class to create a mock connector client for unit testing.
*/
protected createConnectorClient(serviceUrl: string): ConnectorClient {
public createConnectorClient(serviceUrl: string): ConnectorClient {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched this to public because the BotFrameworkAdapter.credentials is protected, and ConnectorClient.credentials is not.

I also wanted the new ConnectorClient to include the USER_AGENT, not sure if this is a problem in C#...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you not make the Credentials on ConnectorClient public - that would also bring the two implementations closer together.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The credentials in the connectorClient are public, I use them in TeamsInfo.getTeamsConnectorClient()

return new TeamsConnectorClient(connectorClient.credentials, { baseUri: context.activity.serviceUrl });

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding USER_AGENT header - the C# uses the same HttpClient as the regular connector. So that should be good.
Its really just a couple of extra REST calls on top of the current connector

@stevengum stevengum changed the title Add TeamsInfo helper class, minor fix in ConversationUpdateBot scenario [Teams] Add TeamsInfo helper class, minor fix in ConversationUpdateBot scenario Oct 4, 2019
@johnataylor
Copy link
Member

and we need some additional unit tests?

@stevengum stevengum merged commit 754dd39 into master Oct 4, 2019
@stevengum stevengum deleted the stgum/teamsInfo branch October 4, 2019 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.6 4.6 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Teams] Add TeamsActivityHandler to botbuilder
3 participants