Skip to content

Commit

Permalink
Fix bug in GroupCaseAction
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric L. Charlier committed Jan 17, 2016
1 parent 6a9fb55 commit d426b6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public void SetupTest()
{
if (File.Exists(TargetFilename))
File.Delete(TargetFilename);

//if(File.Exists(CsvFilename))
// File.Delete(CsvFilename);
}

//Called after each test
Expand All @@ -49,13 +46,17 @@ public void TearDownTest()
#endregion

[Test]
public void Execute_Group_FileGenerated()
public void Execute_Group_FileGeneratedWithoutListString()
{
var generator = new TestSuiteGenerator();
generator.Load(DefinitionFilename);
generator.Execute();

Assert.That(File.Exists(TargetFilename));
var text = File.ReadAllText(TargetFilename);
Assert.That(text, Is.Not.StringContaining("System.Collections.Generic.List`1[System.String]"));
Assert.That(text, Is.StringContaining("<category>91675</category>"));
Assert.That(text, Is.StringContaining("<category>75755</category>"));
}


Expand Down
2 changes: 1 addition & 1 deletion NBi.Testing/NBi.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<Compile Include="..\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="Acceptance\GenbiL\ConcatenateSplitGroup.cs" />
<Compile Include="Acceptance\GenbiL\ConcatenateSplitGroupTest.cs" />
<Compile Include="Acceptance\GenbiL\GroupTest.cs" />
<Compile Include="Acceptance\GenbiL\CommentTest.cs" />
<Compile Include="Acceptance\GenbiL\GroupReduceTest.cs" />
Expand Down
7 changes: 5 additions & 2 deletions NBi.genbiL/Action/Case/GroupCaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public void Execute(GenerationState state)
if (dataTable.Rows[firstRow][columnListId] == DBNull.Value)
dataTable.Rows[firstRow][columnListId] = new List<string>();

var list = dataTable.Rows[firstRow][columnListId] as IList<string>;
list.Add(dataTable.Rows[i][columnId].ToString());
var list = dataTable.Rows[firstRow][columnListId] as List<string>;
if (dataTable.Rows[i][columnId] is IEnumerable<string>)
list.AddRange(dataTable.Rows[i][columnId] as IEnumerable<string>);
else
list.Add(dataTable.Rows[i][columnId].ToString());
}

if (isIdentical && i != 0)
Expand Down

0 comments on commit d426b6f

Please sign in to comment.