locked
Run and Build a docker container to use in integration tests RRS feed

  • Question

  • User-585144208 posted

    Hi

    I am doing integration test for HostedService in asp.net core, but I want to run a docker container before the test starts. The test has a dependency on API service. I want to fake that API using the approach described "Here". 

    So is there any command or call, for example in IApplicationBuilder that can run docker compose ? 

    Saturday, March 13, 2021 10:56 AM

All replies

  • Saturday, March 13, 2021 5:45 PM
  • User1120430333 posted

    An integration test is about testing something for real. So I don't see how faking anything is determined to be an integration test.

    Sunday, March 14, 2021 12:03 AM
  • User-585144208 posted

    An integration test is about testing something for real. So I don't see how faking anything is determined to be an integration test.

    The question is how to run a docker container before the integration tests starts, and I know in integration test we should not use FAKE!. I think you did not read the question carefully. The container could be a SQL instance or anything. 

    Sunday, March 14, 2021 11:01 AM
  • User1120430333 posted

    DA924

    An integration test is about testing something for real. So I don't see how faking anything is determined to be an integration test.

    The question is how to run a docker container before the integration tests starts, and I know in integration test we should not use FAKE!. I think you did not read the question carefully. The container could be a SQL instance or anything. 

    I want to fake that API using the approach described 

    I am only going by what you wrote. Maybe, you should not have used the word fake and used another word to describe the event based on the description of an integration test.

    Sunday, March 14, 2021 12:25 PM