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


C# Table.AddRow方法代码示例

本文整理汇总了C#中Table.AddRow方法的典型用法代码示例。如果您正苦于以下问题:C# Table.AddRow方法的具体用法?C# Table.AddRow怎么用?C# Table.AddRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table.AddRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Returns_two_instances_when_there_are_two_rows

 public void Returns_two_instances_when_there_are_two_rows()
 {
     var table = new Table("FirstName");
     table.AddRow("John");
     table.AddRow("Howard");
     var people = table.CreateSet<Person>();
     people.Count().ShouldEqual(2);
 }
开发者ID:PeteProgrammer,项目名称:SpecFlow,代码行数:8,代码来源:CreateSetHelperMethodTests.cs

示例2: Returns_instance_on_full_match

        public void Returns_instance_on_full_match()
        {
            var table = new Table("Field", "Value");
            table.AddRow("String Property", "Joel Mario");
            table.AddRow("Int Property", "20");

            var result = table.FindInSet(testSet);

            result.Should().BeSameAs(testSet[1]);
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:10,代码来源:FindInSetExtensionMethodTests.cs

示例3: Sets_string_values

        public virtual void Sets_string_values()
        {
            var table = new Table("Field", "Value");
            table.AddRow("FirstName", "John");
            table.AddRow("LastName", "Galt");

            var person = GetThePerson(table);

            person.FirstName.Should().Be("John");
            person.LastName.Should().Be("Galt");
        }
开发者ID:ethanmoffat,项目名称:SpecFlow,代码行数:11,代码来源:CreateInstanceHelperMethodTestBase.cs

示例4: The_correct_TableRow_is_passed_to_the_callback

        public void The_correct_TableRow_is_passed_to_the_callback()
        {
            var table = new Table("FirstName", "_SpecialInfo");
            table.AddRow("John", "John Info");
            table.AddRow("Howard", "Howard Info");

            var people = table.CreateSet(row => new Person() {LastName = row["_SpecialInfo"]});

            foreach (var person in people)
                LastNameString_ShouldStartWith_FirstNameString(person);
        }
开发者ID:techtalk,项目名称:SpecFlow,代码行数:11,代码来源:CreateSetHelperMethodTests_WithFuncAndTableRowArgument.cs

示例5: Sets_string_values

        public void Sets_string_values()
        {
            var table = new Table("Field", "Value");
            table.AddRow("FirstName", "John");
            table.AddRow("LastName", "Galt");

            var person = table.CreateInstance<Person>();

            person.FirstName.ShouldEqual("John");
            person.LastName.ShouldEqual("Galt");
        }
开发者ID:otac0n,项目名称:SpecFlow,代码行数:11,代码来源:CreateInstanceHelperMethodTests.cs

示例6: Returns_match_on_full_match

        public void Returns_match_on_full_match()
        {
            var table = new Table("Field", "Value");
            table.AddRow("String Property", "Joel Mario");
            table.AddRow("Int Property", "20");

            var results = table.FindAllInSet(testSet);

            results.Count().Should().Be(1);
            results.First().IntProperty.Should().Be(20);
            results.First().StringProperty.Should().Be("Joel Mario");
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:12,代码来源:FindAllInSetExtensionMethodsTests.cs

示例7: Create_instance_will_fill_the_instance_

        public void Create_instance_will_fill_the_instance_()
        {
            var table = new Table("Field", "Value");
            table.AddRow("FirstName", "John");
            table.AddRow("LastName", "Galt");

            var expectedPerson = new Person { FirstName = "Ellsworth", LastName = "Toohey" };
            var person = table.CreateInstance(() => expectedPerson);

            person.FirstName.Should().Be("John");
            person.LastName.Should().Be("Galt");
        }
开发者ID:ethanmoffat,项目名称:SpecFlow,代码行数:12,代码来源:CreateInstanceHelperMethodTests_WithFunc.cs

示例8: Can_create_an_instance_with_similar_enum_values

        public void Can_create_an_instance_with_similar_enum_values()
        {
            var table = new Table("Field", "Value");
            table.AddRow("FourthColor", "Green");
            table.AddRow("ThirdColor", "Red");
            table.AddRow("SecondColor", "Red");
            table.AddRow("FirstColor", "Red");

            var @class = table.CreateInstance<AClassWithMultipleEnums>();

            @class.FirstColor.ShouldEqual(AClassWithMultipleEnums.Color.Red);
            @class.SecondColor.ShouldEqual(AClassWithMultipleEnums.ColorAgain.Red);
            @class.ThirdColor.ShouldEqual(AClassWithMultipleEnums.Color.Red);
            @class.FourthColor.ShouldEqual(AClassWithMultipleEnums.ColorAgain.Green);
        }
开发者ID:BEllis,项目名称:SpecFlow,代码行数:15,代码来源:CreateInstanceHelperMethodTests.cs

示例9: GetString_should_return_null_if_the_value_is_not_defined

 public void GetString_should_return_null_if_the_value_is_not_defined()
 {
     var table = new Table("Name");
     table.AddRow("John Galt");
     table.Rows.First()
         .GetString("SomethingThatDoesNotExist").ShouldEqual(null);
 }
开发者ID:Galad,项目名称:SpecFlow,代码行数:7,代码来源:RowExtensionMethodTests.cs

示例10: GetString_should_return_the_string_value_from_the_row

 public void GetString_should_return_the_string_value_from_the_row()
 {
     var table = new Table("Name");
     table.AddRow("John Galt");
     table.Rows.First()
         .GetString("Name").ShouldEqual("John Galt");
 }
开发者ID:Galad,项目名称:SpecFlow,代码行数:7,代码来源:RowExtensionMethodTests.cs

示例11: CreateAnInstanceTableForThisItemInTheSet

 private Table CreateAnInstanceTableForThisItemInTheSet(int index)
 {
     var instanceTable = new Table("Field", "Value");
     foreach (var header in table.Header)
         instanceTable.AddRow(header, table.Rows[index][header]);
     return instanceTable;
 }
开发者ID:wbagit,项目名称:SpecFlow,代码行数:7,代码来源:PivotTable.cs

示例12: It_returns_null_when_no_match_can_be_found

        public void It_returns_null_when_no_match_can_be_found()
        {
            var table = new Table("Field", "Value");
            table.AddRow("String Property", "Peter Keating");

            table.FindInSet(testSet).Should().BeNull();
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:7,代码来源:FindInSetExtensionMethodTests.cs

示例13: Throws_exception_when_first_row_matches_but_second_does_not

        public void Throws_exception_when_first_row_matches_but_second_does_not()
        {
            var table = new Table("Field", "Value");
            table.AddRow("StringProperty", "Howard Roark");
            table.AddRow("IntProperty", "20");

            var test = new InstanceComparisonTestObject
                           {
                               StringProperty = "Howard Roark",
                               IntProperty = 10
                           };

            ComparisonTestResult comparisonResult = ExceptionWasThrownByThisComparison(table, test);

            comparisonResult.ExceptionWasThrown.ShouldBeTrue();
        }
开发者ID:roffster,项目名称:SpecFlow,代码行数:16,代码来源:InstanceComparisonExtensionMethodsTests.cs

示例14: GetDecimal_should_return_MinValue_when_the_value_is_not_defined

 public void GetDecimal_should_return_MinValue_when_the_value_is_not_defined()
 {
     var table = new Table("Amount");
     table.AddRow("4.01");
     table.Rows.First()
         .GetDecimal("SomethingThatDoesNotExist").ShouldEqual(decimal.MinValue);
 }
开发者ID:Galad,项目名称:SpecFlow,代码行数:7,代码来源:RowExtensionMethodTests.cs

示例15: GetInt_should_return_MinValue_when_the_value_is_empty

 public void GetInt_should_return_MinValue_when_the_value_is_empty()
 {
     var table = new Table("Count");
     table.AddRow("");
     table.Rows.First()
         .GetInt32("Count").ShouldEqual(int.MinValue);
 }
开发者ID:Galad,项目名称:SpecFlow,代码行数:7,代码来源:RowExtensionMethodTests.cs


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