Comments (12)
@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 (:
from matterhook.net.matterhookclient.
@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 HttpMessageHandler
.
from matterhook.net.matterhookclient.
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 :)
from matterhook.net.matterhookclient.
Hi everyone,
I would like to give this a shot.
Would it be ok to provide a webhook URL from the app.config since the webhook endpoint should be kept secret?
Are there any specific cases you would like to be covered?
from matterhook.net.matterhookclient.
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... 🤷♂️
from matterhook.net.matterhookclient.
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.
from matterhook.net.matterhookclient.
Just going to drop this here to remember to read it later:
https://github.com/WireMock-Net/WireMock.Net
from matterhook.net.matterhookclient.
After reading a while, a possible solution would be to mock (using Moq) HttpMessageHandler
to return a OK
response that contains the json we sent. This way we could test if the json looks like it should.
Here the article
from matterhook.net.matterhookclient.
@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.
from matterhook.net.matterhookclient.
hey @cindra10 😄 are you working / gonna work on it at the end?
from matterhook.net.matterhookclient.
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? :)
from matterhook.net.matterhookclient.
First goes first @cindra10!! Thanks for the quick response! 😄 Sure! We'll let you know once implemented!
from matterhook.net.matterhookclient.
Related Issues (13)
- Problem with System.http. not found at runtime HOT 10
- Feature Interactive Message Buttons HOT 8
- More intelligent text splitting HOT 3
- Support Message Menus HOT 3
- Branches for new releases HOT 5
- Appveyor PR builds failing HOT 3
- StringSplitter Exceptions HOT 7
- appveyor yaml appending -dev to tagged version HOT 3
- README Overhaul
- Matterhook.NET.MatterhookClient v1.5
- Add interactive dialogs support HOT 2
- How can I get the "post id" after posting a message HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matterhook.net.matterhookclient.