I want to index each element of a list using an array. For example, I want to use `list[arr] = 1`, where `arr` is an array instead of `list[ind] = 1` where `ind` is a number index. Using Dictionary data structure does the job, but creation of the dictionary is time consuming. Is there any other way I can do the above?
['https://Stackoverflow.com/questions/25645859', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2445465/']
Using [Feature Context](https://github.com/techtalk/SpecFlow/wiki/FeatureContext), you could probably have each sentence start with something like this...

```
Given Previous tests did not fail

```

In that sentence, you verify the current feature context doesn't have a false value. That might look something like this...

```
bool testsPass = FeatureContext.Current["TestsPass"];
Assert.IsTrue(testsPass);

```

You would have to remember to set this value before any assert. Off hand, that might look something like this...

```
bool testPassed = //something to test
FeatureContext.Current["testsPass"] = testPassed;
Assert.IsTrue(testPassed);

```

As the comment said, typically it's not a good idea to expect scenarios to always run in a particular order. Depending on the runner, they may not do as expected.

Note: on second look, a BeforeScenario might work better but I would still suggest using a @serial tag or something to indicate that's what it's doing.
I don't know if stopping the entire feature run is possible, after all really all that specflow does is generate tests in the framework of your choice which are then run by some test runner. No unit test runner I know will allow a complete abort of all other tests if one fails. But that doesn't mean that what you want isn't possible.

I can think of a way to 'fake' what you want, but its a bad idea. you could set some sort of flag in the AfterScenario (like creating a file on the disk or setting a mutex) and then checking for this flag in the BeforeScenario and failing fast (with a message like 'skipping test as previous failure detected') if the flag exists. You could clear the flag on the BeforeFeature to ensure that the tests always start clean.

Like I said I think this is a bad idea and you should really reconsider how your tests work.

Based on the extra information given in your last comment it seems that even though you recreate your db for the feature and then run multiple scenarios on the clean db, actually each scenario needs its own clean database. Could you not create a new database for each scenario and then have a single scenario create all the data it needs in its given and then test only a single thing? This seems much more scalable and maintainable in the long term to me.

I have done something similar to this before and created a new database for each scenario and it has worked ok.