本文整理汇总了C#中TechTalk.SpecFlow.Table.ContainsColumn方法的典型用法代码示例。如果您正苦于以下问题:C# Table.ContainsColumn方法的具体用法?C# Table.ContainsColumn怎么用?C# Table.ContainsColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TechTalk.SpecFlow.Table
的用法示例。
在下文中一共展示了Table.ContainsColumn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IHaveAGameOfPong
public void IHaveAGameOfPong(Table table)
{
BallInitializer = new RiggedBallInitializer();
var game = Create2PlayerPongGame();
if (table != null)
{
if (table.ContainsColumn("Player Slot") || table.ContainsColumn("Spawn Position"))
{
game.PlayerSlots = (from row in table.Rows
orderby row["Player Slot"]
select new PlayerSlot { SpawnPosition = ParsePoint(row["Spawn Position"]) }).ToArray();
}
if (table.ContainsColumn("Width") || table.ContainsColumn("Height"))
{
game.Width = int.Parse(table.Rows[0]["Width"]);
game.Height = int.Parse(table.Rows[0]["Height"]);
}
}
Game = game;
}
示例2: GivenTheVersionScripts
public void GivenTheVersionScripts(Table table)
{
foreach (var row in table.Rows)
{
string schema = row["Schema"];
string version = row["Version"];
string script = row["Script"];
string skip = null;
if (table.ContainsColumn("Skip"))
{
skip = row["Skip"];
}
dataContext.Versions.Add(new Migrate.MigrationVersion(schema, version,
dataContext.VersionStrategy.GetNumericVersion(version), null, skip, script));
}
dataContext.SortVersions();
}
示例3: ThenTheDatabaseShouldContain
public void ThenTheDatabaseShouldContain(Table table)
{
IDataReader reader = dataContext.Execute("SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS");
var dt = new DataTable();
dt.Load(reader);
foreach (var row in table.Rows)
{
string query = "TABLE_NAME='" + row["Table"] + "'";
if (table.ContainsColumn("Column"))
{
query += " AND COLUMN_NAME ='" + row["Column"] + "'";
}
Assert.AreNotEqual(0, dt.Select(query).Length);
}
}
示例4: GivenAFixtureWithTheFollowingMarkets
public void GivenAFixtureWithTheFollowingMarkets(Table table)
{
ScenarioContext.Current.Clear();
Fixture fixture = new Fixture { Id = "Test", MatchStatus = "40" };
ScenarioContext.Current.Add("FIXTURE", fixture);
foreach (var row in table.Rows)
{
Market mkt = new Market {Id = row["Market"]};
mkt.AddOrUpdateTagValue("name", row["Name"]);
fixture.Markets.Add(mkt);
if (table.ContainsColumn("Selections"))
{
int seln_count = Convert.ToInt32(row["Selections"]);
for (int i = 0; i < seln_count; i++)
{
Selection seln = new Selection { Name = row["Name"] + (i + 1) };
seln.Id = seln.Name;
mkt.Selections.Add(seln);
}
}
}
}
示例5: RunAssertions
private void RunAssertions(Table table, string target)
{
foreach (var row in table.Rows)
{
if (row["expected"].Equals("N/A", StringComparison.CurrentCultureIgnoreCase)) { continue; }
When(string.Format("the following query is run against {0}: {1}", target, row["query"]));
if (table.ContainsColumn("name"))
{
When(string.Format("query description is '{0}'", row["name"]));
}
Then(string.Format("the result should be {0}", row["expected"]));
}
}