Skip to content

Commit

Permalink
fixed RowFixture bug which caused dups to show up as missing and surplus
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Mar 30, 2005
1 parent 857b10b commit 55fc810
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 1 deletion.
Binary file modified dotnet/FitServer.exe
Binary file not shown.
Binary file modified dotnet/TestRunner.exe
Binary file not shown.
Binary file modified dotnet/acceptanceTests.dll
Binary file not shown.
Binary file modified dotnet/eg.dll
Binary file not shown.
Binary file modified dotnet/fit.dll
Binary file not shown.
1 change: 1 addition & 0 deletions dotnet/src/TestRunner/.cvsignore
@@ -0,0 +1 @@
TestRunner.csproj.user
5 changes: 4 additions & 1 deletion dotnet/src/fit/RowFixture.cs
Expand Up @@ -99,7 +99,10 @@ private object FindMatchingObject(ArrayList queryItems, Parse row, int col)
}
if (UniqueMatchFound(matches))
return UniqueMatch(matches);
return FindMatchingObject(queryItems, row, col + 1);
else if (matches.Count > 0 && !ColumnHasBinding(col + 1))
return matches[0];
else
return FindMatchingObject(queryItems, row, col + 1);
}

private bool IsMatch(Parse row, int col)
Expand Down
11 changes: 11 additions & 0 deletions dotnet/src/fit/RowFixtureTest.cs
Expand Up @@ -261,6 +261,17 @@ public void TestOneExpectedOneActualIncorrect()
AssertTextInBody(table.At(0,3,0), "surplus");
}

[Test]
public void TestDupsAllowed()
{
AddQueryValue(new RowFixturePerson("Joe"));
AddQueryValue(new RowFixturePerson("Joe"));
AddRow(new string[] {"Joe"});
AddRow(new string[] {"Joe"});
fixture.DoTables(table);
VerifyCounts(2, 0, 0, 0);
}

[Test]
public void TestTwoExpectedTwoActualAllCorrectOrderCorrect()
{
Expand Down

0 comments on commit 55fc810

Please sign in to comment.