Skip to content

Create unit/integration tests #82

Open

Description

@onionhammer

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.

Activity

  1. faniereynders commented on Jan 29, 2016

    @faniereynders
    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.

  2. faniereynders commented on Jan 29, 2016

    @faniereynders
    Member

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

  3. onionhammer commented on Jan 29, 2016

    @onionhammer
    CollaboratorAuthor

    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.

  4. faniereynders commented on Jan 29, 2016

    @faniereynders
    Member

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

  5. onionhammer commented on Jan 29, 2016

    @onionhammer
    CollaboratorAuthor

    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

  6. faniereynders commented on Jan 30, 2016

    @faniereynders
    Member

    What about testing the JavaScript client?

  7. onionhammer commented on Jan 30, 2016

    @onionhammer
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions