public void Should_subtract_zero_fractions() { Assert.That(FractionCalculator.Subtract(new Fraction(0, 0), new Fraction(0, 0)), Is.EqualTo(new Fraction(0, 0))); }
public void Should_subtract_negative_fractions(int minuendNumerator, int minuendDenominator, int subtrahendNumerator, int subtrahendDenominator, int expectedNumerator, int expectedDenominator) { Assert.That(FractionCalculator.Subtract(new Fraction(minuendNumerator, minuendDenominator), new Fraction(subtrahendNumerator, subtrahendDenominator)), Is.EqualTo(new Fraction(expectedNumerator, expectedDenominator))); }
public void Should_subtract_fractions_with_same_denominator() { Assert.That(FractionCalculator.Subtract(new Fraction(4, 5), new Fraction(1, 5)), Is.EqualTo(new Fraction(3, 5))); }
public void Should_subtract_fractions_with_different_denominator() { Assert.That(FractionCalculator.Subtract(new Fraction(3, 4), new Fraction(2, 5)), Is.EqualTo(new Fraction(7, 20))); }
public void Should_subtract_negative_whole_numbers(int minuendNumerator, int subtrahendNumerator, int expectedNumerator) { Assert.That(FractionCalculator.Subtract(new Fraction(minuendNumerator), new Fraction(subtrahendNumerator)), Is.EqualTo(new Fraction(expectedNumerator))); }