当前位置: 首页>>代码示例>>C#>>正文


C# Table.ContainsColumn方法代码示例

本文整理汇总了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;
 }
开发者ID:kibiz0r,项目名称:Pong,代码行数:20,代码来源:InitializationSteps.cs

示例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();
        }
开发者ID:proferosydney,项目名称:tern,代码行数:20,代码来源:VersioningSteps.cs

示例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);
            }
        }
开发者ID:proferosydney,项目名称:tern,代码行数:19,代码来源:VersioningSteps.cs

示例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);
                    }
                }
            }
        }
开发者ID:luxbet,项目名称:SS.Integration.Adapter,代码行数:26,代码来源:MarketFiltersSteps.cs

示例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"]));
            }
        }
开发者ID:shtusha,项目名称:funckyHTTP,代码行数:16,代码来源:Xml.cs


注:本文中的TechTalk.SpecFlow.Table.ContainsColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。