azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

How to write unit tests for this

Open zebslc opened this issue 1 year ago • 3 comments

Please can you add a section about how to set up these for testing as per the question raised in https://github.com/Azure/azure-sdk-for-net/issues/30928

It would be good to see a complete mocked sample document in order to speed up developers adopting this in their unit tests as so many items in the intellisense list are internal methods which makes it harder to just get started.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

zebslc avatar Sep 05 '22 15:09 zebslc

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jsquire avatar Sep 05 '22 15:09 jsquire

@zebslc Thank you for your feedback. I can totally understand how mocking DocumentField could be tricky. We have a added a sample to illustrate how mocking works in our library (you can check it by clicking here). Please let us know if you have further questions.

kinelski avatar Sep 21 '22 20:09 kinelski

That is brilliant. Thank you :-)

On Wed, 21 Sept 2022 at 21:10, Caio Saldanha @.***> wrote:

@zebslc https://github.com/zebslc Thank you for your feedback. I can totally understand how mocking DocumentField could be tricky. We have a added a sample to illustrate how mocking works in our library (you can check it by clicking here https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_MockClient.md). Please let us know if you have further questions.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-net/issues/30941#issuecomment-1254177314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2MP44AZKZNHNTT4KHRWSDV7NTSVANCNFSM6AAAAAAQFC3NXQ . You are receiving this because you were mentioned.Message ID: @.***>

--

Our new children's pirate book available on iTunes - http://tinyurl.com/5PiratesGTH

zebslc avatar Sep 22 '22 05:09 zebslc

Closing this issue since it seems to be addressed. Please feel free to open a new one if you have further questions.

kinelski avatar Sep 22 '22 18:09 kinelski