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

[BUG] Azure.Communication.Chat is not mockable #46283

Open
cmeyertons opened this issue Sep 25, 2024 · 4 comments
Open

[BUG] Azure.Communication.Chat is not mockable #46283

cmeyertons opened this issue Sep 25, 2024 · 4 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Communication customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@cmeyertons
Copy link

cmeyertons commented Sep 25, 2024

Library name and version

Azure.Communication.Chat 1.3.1

Describe the bug

The Azure Communication Chat library is not mockable.

Especially for a service that I cannot emulate locally, I need to be able to mock out the interactions with it.

Expected behavior

I would expect the library to adhere to the design guidlines for testability:

https://learn.microsoft.com/en-us/dotnet/azure/sdk/unit-testing-mocking?tabs=csharp

Actual behavior

I cannot mock:

  • CreateChatThreadResult
  • ChatThreadProperties
  • there's probably many more

Reproduction Steps

n/a

Environment

No response

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Communication customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Sep 25, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @acsdevx-msft.

@jsquire jsquire self-assigned this Sep 25, 2024
@jsquire
Copy link
Member

jsquire commented Sep 25, 2024

Hi @cmeyertons. Thanks for reaching out and we regret that you're experiencing difficulties. To our knowledge, the Chat library is following Azure SDK standards for mockability and testing. As the unit testing article describes in the note from this section:

Some input models have read-only properties that are only populated when the model is returned by the service. In this case, a model factory method will be available that allows setting these properties.

The types that you're asking about fall into that category and can be created using the ChatModelFactory:

If there are types that are not publicly constructable and do not exist in the model factory, please let us know so that we can make the necessary adjustments.

@jsquire jsquire added needs-author-feedback Workflow: More information is needed from author to address the issue. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Sep 25, 2024
Copy link

Hi @cmeyertons. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@jsquire jsquire added issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Sep 30, 2024
Copy link

Hi @cmeyertons. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Communication customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants