Building Web APIs Part 2

Sign in to queue

The Discussion

  • User profile image
    AjmalY

    Dear Chris, I liked very much both the episode. Thanks a lot for showing the interrogation test.

    When I run the test, I got error, saying connection string is missing,

    Message: System.ArgumentNullException : Value cannot be null.
    Parameter name: connectionString

     

    What I'm missing here? Thanks!
     

  • User profile image
    Chris​Woodruff

    @AjmalY: I have run into that issue before and have a workaround. Take a look at my configuration class for ConnectionString.

    https://github.com/cwoodruff/ChinookASPNETCoreAPINTier/blob/master/ChinookASPNETCoreAPINTier/Chinook.API/Configurations/ConfigureConnections.cs

    I am not happy with the workaround but it resolves the issue. I am trying to find a better solution.

  • User profile image
    AjmalY

    @ChrisWoodruff: Thanks, the workaround works. So currently this integration test hits the real database.

  • User profile image
    burrows_rMVP

    I noticed that the code Chris provided to resolve AjmalY's error (one I also encountered) requires a considerably more complex API than was created in Part 1 and used in Part 2.

    I assume there is no way to run the integration tests using the simpler API provided in this series (so far).

  • User profile image
    AjmalY

    One question I would like to ask, Is "Microsoft Fakes" is dead, I'm not seeing any latest code/video on the topic. Can someone suggest.

  • User profile image
    tabiAhmed

    ChrisWoodruff if we have 100 of end points in our API, how we write integration test for all of these. Assume that we have legacy code and at that time we ignore integration test. Any suggestions? 

Add Your 2 Cents