fixed culture issue

This commit is contained in:
Charlie Kindel
2020-06-08 18:23:53 -06:00
2 changed files with 18 additions and 12 deletions

View File

@@ -97,12 +97,15 @@ namespace Terminal.Gui {
[Fact]
public void Percent_SetsValue ()
{
var dim = Dim.Percent (0);
Assert.Equal ("Dim.Factor(0)", dim.ToString ());
dim = Dim.Percent (0.5F);
Assert.Equal ("Dim.Factor(0.005)", dim.ToString ());
dim = Dim.Percent (100);
Assert.Equal ("Dim.Factor(1)", dim.ToString ());
float f = 0;
var dim = Dim.Percent (f);
Assert.Equal ($"Dim.Factor({f/100:0.###})", dim.ToString ());
f = 0.5F;
dim = Dim.Percent (f);
Assert.Equal ($"Dim.Factor({f/100:0.###})", dim.ToString ());
f = 100;
dim = Dim.Percent (f);
Assert.Equal ($"Dim.Factor({f/100:0.###})", dim.ToString ());
}
// TODO: Other Dim.Percent tests (e.g. Equal?)

View File

@@ -155,12 +155,15 @@ namespace Terminal.Gui {
[Fact]
public void Percent_SetsValue ()
{
var pos = Pos.Percent (0);
Assert.Equal ("Pos.Factor(0)", pos.ToString ());
pos = Pos.Percent (0.5F);
Assert.Equal ("Pos.Factor(0.005)", pos.ToString ());
pos = Pos.Percent (100);
Assert.Equal ("Pos.Factor(1)", pos.ToString ());
float f = 0;
var pos = Pos.Percent (f);
Assert.Equal ($"Pos.Factor({f / 100:0.###})", pos.ToString ());
f = 0.5F;
pos = Pos.Percent (f);
Assert.Equal ($"Pos.Factor({f / 100:0.###})", pos.ToString ());
f = 100;
pos = Pos.Percent (f);
Assert.Equal ($"Pos.Factor({f / 100:0.###})", pos.ToString ());
}
[Fact]