當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。