Пример #1
0
        public void Iteration7Test()
        {
            // Arrange
            BigRational two = new(2);

            BigInteger expectedNumerator   = 1393;
            BigInteger expectedDenominator = 985;

            // Act
            BigRational innerExpression1 = Problem57.CalculateInnerExpression(two);
            BigRational innerExpression2 = Problem57.CalculateInnerExpression(innerExpression1);
            BigRational innerExpression3 = Problem57.CalculateInnerExpression(innerExpression2);
            BigRational innerExpression4 = Problem57.CalculateInnerExpression(innerExpression3);
            BigRational innerExpression5 = Problem57.CalculateInnerExpression(innerExpression4);
            BigRational innerExpression6 = Problem57.CalculateInnerExpression(innerExpression5);
            BigRational innerExpression7 = Problem57.CalculateInnerExpression(innerExpression6);
            BigRational outerExpression  = Problem57.CalculateOuterExpression(innerExpression7);

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(outerExpression.Numerator, Is.EqualTo(expectedNumerator));
                Assert.That(outerExpression.Denominator, Is.EqualTo(expectedDenominator));
            });
        }
Пример #2
0
        public void InnerExpressionTest()
        {
            // Arrange
            BigRational two = new(2);

            BigInteger expectedNumerator   = 5;
            BigInteger expectedDenominator = 2;

            // Act
            BigRational innerExpression = Problem57.CalculateInnerExpression(two);

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(innerExpression.Numerator, Is.EqualTo(expectedNumerator));
                Assert.That(innerExpression.Denominator, Is.EqualTo(expectedDenominator));
            });
        }