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 ?
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.
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.
If you find the post has answered your issue, then please mark post as 'answered'.
Member
2 Points
56 Posts
Run and Build a docker container to use in integration tests
Mar 13, 2021 10:56 AM|b.dev|LINK
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 ?
All-Star
58464 Points
15788 Posts
Re: Run and Build a docker container to use in integration tests
Mar 13, 2021 05:45 PM|bruce (sqlwork.com)|LINK
You would run a process
https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=net-5.0
Contributor
4973 Points
4263 Posts
Re: Run and Build a docker container to use in integration tests
Mar 14, 2021 12:03 AM|DA924|LINK
An integration test is about testing something for real. So I don't see how faking anything is determined to be an integration test.
Member
2 Points
56 Posts
Re: Run and Build a docker container to use in integration tests
Mar 14, 2021 11:01 AM|b.dev|LINK
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.
Contributor
4973 Points
4263 Posts
Re: Run and Build a docker container to use in integration tests
Mar 14, 2021 12:25 PM|DA924|LINK
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.