В то время как ОП указывал v3.5, вопрос задавался до выхода v4. Чтобы помочь любому, кто найдет этот вопрос и , жить с зависимостью v4, группа разработчиков создала новый кэш общего назначения для этого типа сценария. Он находится в пространстве имен System.Runtime.Caching: http://msdn.microsoft.com/en-us/library/dd997357%28v=VS.100%29.aspx
Статическая ссылка на экземпляр кэша по умолчанию: MemoryCache.Default
UPDATE: The method described below has been deprecated. The recommended way to call a step from within another step now looks like this:
Given /^I login successfully$/
step "I login with valid credentials"
end
Old, deprecated method (for reference):
You can call steps from other steps like this:
Given /^I login successfully$/
Given "I login with valid credentials"
Then "I should be logged in"
end
If all of the scenarios within a feature require this (or other steps), you can also add a Background to each features, with the common steps, like so:
Background:
Given I log in with valid credentials
Scenario: Change my password
Given I am on the account page