Пример #1
0
        public void TestSumFractions()
        {
            var fraction1 = new Fraction(2, 3);
            var fraction2 = new Fraction(1, 3);

            var expectedFraction = new Fraction(3, 3);

            var result = fraction1 + fraction2;

            var comparisonResult = result.Denominator == expectedFraction.Denominator &&
                                   result.Numerator == expectedFraction.Numerator;

            Assert.AreEqual(comparisonResult,true);
        }
Пример #2
0
 public void TestDefaultConstructor()
 {
     var f = new Fraction();
     bool result = (f.Numerator == 1) && (f.Denominator == 1);
     Assert.AreEqual(true,result);
 }