Skip to content

Instantly share code, notes, and snippets.

@gasparnagy
Created February 17, 2017 08:31
Show Gist options
  • Save gasparnagy/cd9314d1138b202b0f31365a1cba5d2a to your computer and use it in GitHub Desktop.
Save gasparnagy/cd9314d1138b202b0f31365a1cba5d2a to your computer and use it in GitHub Desktop.
public class SharedStepsBaseClass : Steps
{
protected UserContext UserContext
{
get
{
var result = (UserContext)ScenarioContext["userContext"];
if (result == null)
{
result = new UserContext();
ScenarioContext["userContext"] = result;
}
return result;
}
}
}
[Binding]
public class ShareDataWithBaseClassSteps2 : SharedStepsBaseClass
{
[When(@"the user opens the assigned tasks")]
public void WhenTheUserOpensTheAssignedTasks()
{
// Read the user information from the scenario context through the
// property declared in the base class.
var tasks = TaskManagement.GetAssignedTasks(UserContext.UserName);
//...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment