In most cases, when writing an integration specifications against Azure Storage, you want to use the real thing rather than the Storage Emulator as the performance profile and behaviours are noticeably different. One exception is if you've hosted your code in a public repo; in this case you really don't want to commit your real Azure Storage connection details into that repo to allow your integration tests to run on your build server. So it makes more sense to try and make your spec run against the emulator.
Mike Larah wrote a neat little extension for SpecFlow that allows you to specify a
@storage_emulator tag against your scenario and this will seek out the Storage Emulator and invoke it, if it's not already running. The example below shows how simple it is to use:
@container @storage_emulator Scenario: A long running task runs to completion Given the long running task takes 3 seconds to complete And the task is told to cancel if the cancellation token '19d411fc-5014-4eaa-8f84-0fe3d4b93068' is issued And no cancelation token is issued When I execute the task Then it should complete sucessfully
We've released it as a NuGet Package and is available by using the following command:
We also provide extensions for our composition framework:
And for hosting static files: