Remove Person Require People File,
PersonContainer and bug fix for GetRightPadded
This commit is contained in:
@ -92,6 +92,34 @@ public class UnitTestCalculations
|
||||
int checkB = (int)(Math.Round(valueB, Shared.Models.Stateless.ILocation.Digits) * Shared.Models.Stateless.ILocation.Factor);
|
||||
Assert.IsTrue(checkB == 10000);
|
||||
Assert.IsTrue(checkB > checkA);
|
||||
double valueC = 0.06673685709635417;
|
||||
int checkC = (int)(Math.Round(valueC, Shared.Models.Stateless.ILocation.Digits) * Shared.Models.Stateless.ILocation.Factor);
|
||||
string rightPadded = ILocation.GetRightPadded(Shared.Models.Stateless.ILocation.Digits, checkC);
|
||||
Assert.IsTrue(checkC == 66737);
|
||||
Assert.IsTrue(checkC.ToString() != rightPadded);
|
||||
checkC = int.Parse(rightPadded);
|
||||
Assert.IsTrue(checkC == 667370);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodParse()
|
||||
{
|
||||
Assert.IsTrue(long.TryParse("(637967784888423594)"[1..^1], out long ticks));
|
||||
Assert.IsTrue(ticks == 637967784888423594);
|
||||
Assert.IsFalse(long.TryParse("(637967784888423594.61)"[1..^1], out ticks));
|
||||
Assert.IsTrue(ticks == 0);
|
||||
Assert.IsFalse(long.TryParse("(637967784888423594.00)"[1..^1], out ticks));
|
||||
Assert.IsTrue(ticks == 0);
|
||||
long l = 637967784888423594;
|
||||
double d;
|
||||
d = 0.61;
|
||||
Assert.IsTrue($"({l}{d.ToString("0.00")[1..]})" == "(637967784888423594.61)");
|
||||
d = 0.6;
|
||||
Assert.IsTrue($"({l}{d.ToString("0.00")[1..]})" == "(637967784888423594.60)");
|
||||
d = 0.615;
|
||||
Assert.IsTrue($"({l}{d.ToString("0.00")[1..]})" == "(637967784888423594.62)");
|
||||
d = 0.45;
|
||||
Assert.IsTrue($"({l}{d.ToString("0.00")[1..]})" == "(637967784888423594.45)");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user