-
Notifications
You must be signed in to change notification settings - Fork 6
Object tables
msuarz edited this page Sep 12, 2011
·
3 revisions
Use to call steps passing objects as arguments. Each header column matches a property of the object.
Scenario: Login User Given the Users: [ User Name | Password ] | neo | 53cr3t | | lola | run |
public class User
{
public string UserName, Password;
}
Implemented as a single object
public void Given_the_Users_(User User)
{
}
Generates this runner
[TestMethod]
public void LoginUser()
{
Given_the_Users_(
new User
{
UserName = "neo",
Password = "53cr3t"
});
Given_the_Users_(
new User
{
UserName = "lola",
Password = "run"
});
}
Or as a params array
public void Given_the_Users_(params User[] User)
{
}
Generates this runner
[TestMethod]
public void LoginUser()
{
Given_the_Users_
(
new User
{
UserName = "neo",
Password = "53cr3t"
},
new User
{
UserName = "lola",
Password = "run"
}
);
}