Skip to main content
edited body
Source Link

Your specflow file should look like this:

Then the Details page should display the rating zip code
    And the Details page should display
    | Parameter       | Value |
    |  ID             | 5     |
    |  Employee Count | 125   |

And your code should look like this:

[Then(@"the Details page should display")]
public void DetailsPageShouldDisplay(TabkeTable table)
{
   List<TestParameter> detailsParameter = table.CreateSet<TestParameter>().ToList();
   // then iterate through detailsParameter by Name and do proper assertions
}

And your TestParameter class should look like this:

public class TestParameter
{
    [TableAliases("Parameter", "Field")]
    public string Name { get; set; } = "";

    public string Value { get; set; } = "";
}

Your specflow file should look like this:

Then the Details page should display the rating zip code
    And the Details page should display
    | Parameter       | Value |
    |  ID             | 5     |
    |  Employee Count | 125   |

And your code should look like this:

[Then(@"the Details page should display")]
public void DetailsPageShouldDisplay(Tabke table)
{
   List<TestParameter> detailsParameter = table.CreateSet<TestParameter>().ToList();
   // then iterate through detailsParameter by Name and do proper assertions
}

And your TestParameter class should look like this:

public class TestParameter
{
    [TableAliases("Parameter", "Field")]
    public string Name { get; set; } = "";

    public string Value { get; set; } = "";
}

Your specflow file should look like this:

Then the Details page should display the rating zip code
    And the Details page should display
    | Parameter       | Value |
    |  ID             | 5     |
    |  Employee Count | 125   |

And your code should look like this:

[Then(@"the Details page should display")]
public void DetailsPageShouldDisplay(Table table)
{
   List<TestParameter> detailsParameter = table.CreateSet<TestParameter>().ToList();
   // then iterate through detailsParameter by Name and do proper assertions
}

And your TestParameter class should look like this:

public class TestParameter
{
    [TableAliases("Parameter", "Field")]
    public string Name { get; set; } = "";

    public string Value { get; set; } = "";
}
Source Link

Your specflow file should look like this:

Then the Details page should display the rating zip code
    And the Details page should display
    | Parameter       | Value |
    |  ID             | 5     |
    |  Employee Count | 125   |

And your code should look like this:

[Then(@"the Details page should display")]
public void DetailsPageShouldDisplay(Tabke table)
{
   List<TestParameter> detailsParameter = table.CreateSet<TestParameter>().ToList();
   // then iterate through detailsParameter by Name and do proper assertions
}

And your TestParameter class should look like this:

public class TestParameter
{
    [TableAliases("Parameter", "Field")]
    public string Name { get; set; } = "";

    public string Value { get; set; } = "";
}