Skip to content

Commit

Permalink
Add test for dashed column header (see #180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Apr 19, 2022
1 parent 92e9fe2 commit 7c3ded2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Binary file added ExcelMapper.Tests/ProductsDashed.xlsx
Binary file not shown.
22 changes: 22 additions & 0 deletions ExcelMapper.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2625,5 +2625,27 @@ public void EnumTest()

CollectionAssert.AreEqual(products, productsFetched);
}

private record DashedProduct
{
[Column("Name-1")]
public string Name { get; }

public DashedProduct(string name) => Name = name;
}

[Test]
public void DashedTest()
{
var excel = new ExcelMapper("../../../ProductsDashed.xlsx");
var products = excel.Fetch<DashedProduct>().ToList();

CollectionAssert.AreEqual(new List<DashedProduct>
{
new DashedProduct("Nudossi"),
new DashedProduct("Halloren"),
new DashedProduct("Filinchen"),
}, products);
}
}
}

0 comments on commit 7c3ded2

Please sign in to comment.