Re-Write without checking mapped
This commit is contained in:
@ -68,6 +68,9 @@ public class UnitTestCalculations
|
||||
Assert.IsFalse(_PropertyConfiguration is null);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodGetSort() => Assert.IsTrue(new bool[] { true, false }.OrderByDescending(l => l).First());
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodGetAge()
|
||||
{
|
||||
@ -77,4 +80,39 @@ public class UnitTestCalculations
|
||||
Assert.IsTrue(age.Value > 42.6092);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodRound()
|
||||
{
|
||||
Assert.IsTrue(Shared.Models.Stateless.ILocation.Digits == 6);
|
||||
Assert.IsTrue(Shared.Models.Stateless.ILocation.Factor == 1000000);
|
||||
double valueA = 0.00001d;
|
||||
int checkA = (int)(Math.Round(valueA, Shared.Models.Stateless.ILocation.Digits) * Shared.Models.Stateless.ILocation.Factor);
|
||||
Assert.IsTrue(checkA == 10);
|
||||
double valueB = 0.01d;
|
||||
int checkB = (int)(Math.Round(valueB, Shared.Models.Stateless.ILocation.Digits) * Shared.Models.Stateless.ILocation.Factor);
|
||||
Assert.IsTrue(checkB == 10000);
|
||||
Assert.IsTrue(checkB > checkA);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethodRoundB()
|
||||
{
|
||||
const int DistanceDigits = 3;
|
||||
const int DistanceFactor = 1000;
|
||||
const int ToleranceAfterFactor = 600;
|
||||
Assert.IsTrue(DistanceDigits == 3);
|
||||
Assert.IsTrue(DistanceFactor == 1000);
|
||||
Assert.IsTrue(Shared.Models.Stateless.IFaceDistance.Tolerance == 0.6d);
|
||||
Assert.IsTrue(ToleranceAfterFactor == 600);
|
||||
double valueA = 0.00001d;
|
||||
int checkA = (int)(Math.Round(valueA, Shared.Models.Stateless.ILocation.Digits) * Shared.Models.Stateless.ILocation.Factor);
|
||||
Assert.IsTrue(checkA == 10);
|
||||
double valueB = 0.01d;
|
||||
int checkB = (int)(Math.Round(valueB, Shared.Models.Stateless.ILocation.Digits) * Shared.Models.Stateless.ILocation.Factor);
|
||||
Assert.IsTrue(checkB == 10000);
|
||||
Assert.IsTrue(checkB > checkA);
|
||||
int checkC = (int)(Shared.Models.Stateless.IFaceDistance.Tolerance * DistanceFactor);
|
||||
Assert.IsTrue(checkC == ToleranceAfterFactor);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user