Skip to content

Are there any docs or guides on how to write automated tests? #2125

Answered by MichaelHochriegl
jtuchel asked this question in Q&A
Discussion options

You must be logged in to vote

Only solution to properly unit test this lib is to go with the last suggestion in you stackoverflow post.
So you have to create an Interface with an Implementation that uses an injected DiscordSocketClient to it.

Wrap the calls from the DiscordSocketClient in your Interface methods. You can then mock your Interface in your tests.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by csmir
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1957 on February 20, 2022 15:46.