25 lines
661 B
C#
25 lines
661 B
C#
using Managing.Core;
|
|
using Xunit;
|
|
|
|
namespace Managing.Application.Tests
|
|
{
|
|
public class MathHelpersTests
|
|
{
|
|
[Theory]
|
|
[InlineData(0.00010, 4)]
|
|
public void Should_Return_Correct_Precision(decimal n, int expectedValue)
|
|
{
|
|
var precision = MathHelpers.GetDecimalPlaces(n);
|
|
Assert.Equal(expectedValue, precision);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("0.00010", 4)]
|
|
public void Should_Return_Correct_PrecisionTest(string s, int expectedValue)
|
|
{
|
|
var precision = MathHelpers.GetDecimalPlaces(s);
|
|
Assert.Equal(expectedValue, precision);
|
|
}
|
|
}
|
|
}
|