Created
October 12, 2013 07:22
-
-
Save adamralph/6946922 to your computer and use it in GitHub Desktop.
xBehave DRY example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Scenario] | |
public static void DoctorBillPostsToHisOwnBlog() | |
{ | |
GivenIAmLoggedInAs("Dr. Bill", "oranges"); | |
// When, Then... | |
} | |
[Scenario] | |
public static void GregPostsToAClientBlog() | |
{ | |
GivenIAmLoggedInAs("Greg", "apples"); | |
// When, Then... | |
} | |
private static Fluent.IStep GivenIAmLoggedInAs(string username, string password) | |
{ | |
return string.Format("Given I am logged in as {0}", username) | |
.Given(() => Site.Login(username, password)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment