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

Create unit/integration tests #82

Open
onionhammer opened this issue Jan 29, 2016 · 7 comments
Open

Create unit/integration tests #82

onionhammer opened this issue Jan 29, 2016 · 7 comments
Labels

Comments

@onionhammer
Copy link
Collaborator

We need some unit tests!

What we need most (imo) is automatic testing of code generation, ensuring it succeeds and is able to perform web api requests against a test service.

@faniereynders
Copy link
Member

You are absolutely right @onionhammer.

In principle, generation tests don't need to connect to an actual service, as it only requires the metadata response which could be mocked, making verifying the results more accurate.

@faniereynders
Copy link
Member

Unless we really need a set of complete end to end integration tests, if it will add any value

@onionhammer
Copy link
Collaborator Author

I've had some success hosting webapis in-proc (started by the test), not that much harder to do, then we actually exercise the httpclient.

@faniereynders
Copy link
Member

Interesting. @onionhammer care to share an example of how you used it?

@onionhammer
Copy link
Collaborator Author

in a base test, you basically instantiate an HttpServer object (new HttpServer(config)).

I can dig up the code, but it's similar to this: http://blogs.msdn.com/b/youssefm/archive/2013/01/28/writing-tests-for-an-asp-net-webapi-service.aspx

@faniereynders
Copy link
Member

What about testing the JavaScript client?

@onionhammer
Copy link
Collaborator Author

I've not done much JS unit testing, there are some good options I'm sure, and it would be valuable, but you'll have to get someone else to answer that question :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants