예제 #1
0
        public void When_Number1_Is_Strictly_Smaller_Than_Number2_Then_IsStrictlySmallerThan_Should_Return_True(
            double doubleNumber1, double doubleNumber2)
        {
            // Arrange
            var number1 = _calculator.FromDouble(doubleNumber1);
            var number2 = _calculator.FromDouble(doubleNumber2);

            // Act
            var comparison = _calculator.IsStrictlySmallerThan(number1, number2);

            // Assert
            comparison.Should().BeTrue();
        }
예제 #2
0
        public static TAlgebraicNumber Max <TAlgebraicNumber>(
            this IAlgebraicNumberCalculator <TAlgebraicNumber> calculator,
            TAlgebraicNumber first,
            TAlgebraicNumber second)
        {
            if (calculator is null)
            {
                throw new ArgumentNullException(nameof(calculator));
            }

            return(calculator.IsStrictlySmallerThan(first, second) ? second : first);
        }