-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from SebastianWachsmuth/Fix/InvariantToString
add FormattableString.Invariant to ICommand.ToString()
- Loading branch information
Showing
5 changed files
with
45 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Globalization; | ||
|
||
using Xunit; | ||
|
||
namespace SvgPathProperties.UnitTests | ||
{ | ||
public class ToStringTests | ||
{ | ||
[Theory] | ||
//with . separator | ||
[InlineData("en-US", 0, 1.5, 0, 1.5, "L 1.5 1.5")] | ||
|
||
[InlineData("en-US", 0, 1_000_000.5, 0, 1.5, "L 1000000.5 1.5")] | ||
//with , separator | ||
[InlineData("de-DE", 0, 1.5, 0, 1.5, "L 1.5 1.5")] | ||
[InlineData("it-IT", 0, 1.5, 0, 1.5, "L 1.5 1.5")] | ||
[InlineData("es-ES", 0, 1.5, 0, 1.5, "L 1.5 1.5")] | ||
[InlineData("nl-BE", 0, 1.5, 0, 1.5, "L 1.5 1.5")] | ||
|
||
[InlineData("de-DE", 0, 1_000_000.5, 0, 1_000_000.5, "L 1000000.5 1000000.5")] | ||
[InlineData("it-IT", 0, 1_000_000.5, 0, 1_000_000.5, "L 1000000.5 1000000.5")] | ||
[InlineData("es-ES", 0, 1_000_000.5, 0, 1_000_000.5, "L 1000000.5 1000000.5")] | ||
[InlineData("nl-BE", 0, 1_000_000.5, 0, 1_000_000.5, "L 1000000.5 1000000.5")] | ||
// with / separator | ||
[InlineData("fa-IR", 0, 1.5, 0, 1.5, "L 1.5 1.5")] | ||
[InlineData("fa-IR", 0, 1_000_000.5, 0, 1_000_000.5, "L 1000000.5 1000000.5")] | ||
public void CuluresWithPointSeparator(string cultureCode, double fromX, double toX, double fromY, double toY, string result) | ||
{ | ||
var command = new LineCommand(fromX, toX, fromY, toY); | ||
CultureInfo.CurrentCulture = new CultureInfo(cultureCode); ; | ||
|
||
Assert.Equal(result, command.ToString()); | ||
} | ||
} | ||
} |
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
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