This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Potential fix for Issue #12 - pending testing
- Loading branch information
Showing
5 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Simplexcel.XlsxInternal; | ||
using System.Linq; | ||
using Xunit; | ||
|
||
namespace Simplexcel.Tests | ||
{ | ||
public class BugTests | ||
{ | ||
/// <summary> | ||
/// https://github.com/mstum/Simplexcel/issues/12 | ||
/// | ||
/// SharedStrings _sanitizeRegex makes "&" in CellStrings impossible | ||
/// </summary> | ||
[Fact] | ||
public void Issue12_AmpersandInCellValues() | ||
{ | ||
var sharedStrings = new SharedStrings(); | ||
sharedStrings.GetStringIndex("Here & Now"); | ||
sharedStrings.GetStringIndex("&"); | ||
var xmlFile = sharedStrings.ToXmlFile(); | ||
|
||
var nodeValues = xmlFile.Content.Descendants(Namespaces.x + "t").Select(x => x.Value).ToList(); | ||
|
||
Assert.Contains("Here & Now", nodeValues); | ||
Assert.Contains("&", nodeValues); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
using System.Runtime.CompilerServices; | ||
[assembly: InternalsVisibleTo("Simplexcel.Tests")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters