Skip to content

Commit 9d8d696

Browse files
author
Marcus Hammarberg
committed
Added comparision to dynamic set without value conversion
1 parent 2c96e5d commit 9d8d696

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

Specs/Steps/DynamicSetComparisonSteps.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ public void CompareSetToInstance(Table table)
3333
}
3434
}
3535

36+
[When(@"I compare the set to this table using no type conversion")]
37+
public void CompareSetToInstanceNoConversion(Table table)
38+
{
39+
try
40+
{
41+
table.CompareToDynamicSet(State.OriginalSet, false);
42+
}
43+
catch (DynamicSetComparisonException ex)
44+
{
45+
ScenarioContext.Current.Add(EXCEPTION_KEY, ex);
46+
}
47+
}
48+
3649
[Then(@"no set comparison exception should have been thrown")]
3750
public void NoSetExceptionThrown()
3851
{

Specs/Steps/DynamicSetCreationSteps.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ public void WithMethodBInding(Table table)
2323
{
2424
State.OriginalSet = table.CreateDynamicSet().ToList();
2525
}
26-
26+
27+
[Given(@"I create a set of dynamic instances from this table using no type conversion")]
28+
public void WithMethodBIndingNoTypeConversion(Table table)
29+
{
30+
State.OriginalSet = table.CreateDynamicSet(false).ToList();
31+
}
32+
2733

2834
[Then(@"I should have a list of (\d+) dynamic objects")]
2935
public void ShouldContain(int expectedNumberOfItems)

Specs/ValueConversions.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ Scenario: There's ways to disable type conversion for matching a dynamic instanc
7373
| 012345 | 039 |
7474
Then no instance comparison exception should have been thrown
7575

76+
Scenario: Comparing against an identical table should match
77+
Given I create a set of dynamic instances from this table using no type conversion
78+
| Name | Age |
79+
| 012345 | 039 |
80+
| 065484 | 003 |
81+
When I compare the set to this table using no type conversion
82+
| Name | Age |
83+
| 012345 | 039 |
84+
| 065484 | 003 |
85+
Then no set comparison exception should have been thrown

Specs/ValueConversions.feature.cs

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)