Skip to content

Commit

Permalink
#4 add empty line to Converter to separate test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chunxingshen committed Jul 8, 2024
1 parent e8494ee commit d621647
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Cactus.ExcelConverter.MiniExcelConverter/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ public bool ConvertExcelToFeature(string excelFileName)
using (StreamWriter outputFile = new StreamWriter(_featureFile))
{
outputFile.WriteLine(DISCLAIM);
outputFile.WriteLine();
outputFile.WriteLine("Feature: " + Path.GetFileNameWithoutExtension(_excelFile));


var sheetNames = MiniExcel.GetSheetNames(_excelFile);
foreach (var sheetName in sheetNames)
{
outputFile.WriteLine();
outputFile.WriteLine("# " + sheetName);

var rows = MiniExcel.Query(_excelFile, sheetName: sheetName).ToList();
Expand Down
3 changes: 3 additions & 0 deletions test/Cactus.MiniExcelConverterTest/Features/SampleTest.exp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# This feature file was auto generated from Excel by Cactus.net(https://github.com/ITUtopiaIO/Cactus.net)

Feature: SampleTest

# Test1
Scenario: Add two numbers
Given the first number is 50
And the second number is 70
When the two numbers are added
Then the result should be 120

# Test2
Scenario: Add two negative numbers
Given the first number is -50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void ThenTheFeatureFileShouldMatchWith(string expectedFile, string folder
{
FileDiff fileDiff = new FileDiff();
string _expectedFile = Path.Combine(folder, expectedFile);
var result = fileDiff.FileAreSame(_featureFile, _expectedFile);
var result = fileDiff.FileAreSame(_featureFile, _expectedFile, ignoreEmptyLine:false);
Assert.True(result);
}

Expand Down

0 comments on commit d621647

Please sign in to comment.