-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create Unit Tests #11
Comments
Very agree with that. I'm a terrible dev insofar as I never learned to write testable code! All a bit "new fangled" for my experience ;) this project feels like a good fit to start learning, however :) |
Hi everyone, |
Feel free to give it a shot! I think I could probably stand to learn a thing or two myself. RE: Webhook URL. That raises an interesting point. In order to test this library, are we going to need an available endpoint for it to ping? I would have thought the tests would need to be self-contained, and not rely on a (potentially unavailable) external source. Then again, I have no idea what I'm talking about when it comes to tests so... 🤷♂️ |
Tests should be mocked but I've never done any HTTP related testing and this was the first idea I've had. I could do some research on this topic later today. |
Just going to drop this here to remember to read it later: |
@cindra10 if you can inject a url for the endpoints you want to hit, check out nuget package PeanutButter.SimpleHttpServer -- check out the tests here for usage. Happy hacking (: |
@PromoFaux , @cindra10 AFAIK unit tests SHOULD be self-contained. You should not hit any real endpoint in unit tests, that's the case for integration tests. I never tested http methods, but I heard about mocking |
After reading a while, a possible solution would be to mock (using Moq) Here the article |
@rgomez90 You are correct, I was too tired when I initialy responded to this so we can kind of ignore previous replies 😄. I've taken a look at both proposed packages (by @PromoFaux and @fluffynuts), both are relatively easy to setup . Other than that I didn't have much time to investigate, I will take a look at the article you linked ASAP. |
hey @cindra10 😄 are you working / gonna work on it at the end? |
Hi @rgomez90 sorry but I simply can't find time to work on anything currently, college and work are just taking too much effort 😞. Since I'd still like to learn a few things about testing HTTP related projects, could you please let me know when these are implemented so I can take a look? :) |
First goes first @cindra10!! Thanks for the quick response! 😄 Sure! We'll let you know once implemented! |
This repo needs some tests to assure it works as wished 😄
The text was updated successfully, but these errors were encountered: