コード例 #1
0
 public void IsEqual_FractionIsNull_ShouldReturnFalse()
 {
     Fraction.Fraction fraction1 = new Fraction.Fraction();
     fraction1.Numerator   = 3;
     fraction1.Denominator = 2;
     Assert.IsFalse(fraction1.IsEqual(null));
 }
コード例 #2
0
 public void IsEqual_ShortenIsEqual_ShouldReturnTrue()
 {
     Fraction.Fraction fraction1 = new Fraction.Fraction();
     fraction1.Numerator   = 3;
     fraction1.Denominator = 2;
     Fraction.Fraction fraction2 = new Fraction.Fraction();
     fraction2.Numerator   = 6;
     fraction2.Denominator = 4;
     Assert.IsTrue(fraction1.IsEqual(fraction2));
 }
コード例 #3
0
 public void IsEqual_DenominatorTo0_ShouldReturnFalse()
 {
     Fraction.Fraction fraction1 = new Fraction.Fraction();
     fraction1.Numerator   = 3;
     fraction1.Denominator = 0;
     Fraction.Fraction fraction2 = new Fraction.Fraction();
     fraction2.Numerator   = 5;
     fraction2.Denominator = 6;
     Assert.IsFalse(fraction1.IsEqual(fraction2));
 }
コード例 #4
0
 public void IsEqual_InvalidFraction_ShouldReturnFalse()
 {
     // Ungleiche Brüche
     Fraction.Fraction fraction = new Fraction.Fraction();
     Fraction.Fraction other    = new Fraction.Fraction();
     fraction.Numerator   = 3;
     fraction.Denominator = 1;
     other.Numerator      = 6;
     other.Denominator    = 0;
     Assert.IsFalse(fraction.IsEqual(other));
 }
コード例 #5
0
 public void IsEqual_IsEqualAfterNormalize_ShouldReturnTrue()
 {
     // Ungleiche Brüche
     Fraction.Fraction fraction = new Fraction.Fraction();
     Fraction.Fraction other    = new Fraction.Fraction();
     fraction.Numerator   = 3;
     fraction.Denominator = 4;
     other.Numerator      = 6;
     other.Denominator    = 8;
     Assert.IsTrue(fraction.IsEqual(other));
 }
コード例 #6
0
 public void IsEqual_DifferentFractions_ShouldReturnFalse()
 {
     // Ungleiche Brüche
     Fraction.Fraction fraction = new Fraction.Fraction();
     Fraction.Fraction other    = new Fraction.Fraction();
     fraction.Numerator   = 3;
     fraction.Denominator = 4;
     other.Numerator      = 7;
     other.Denominator    = 5;
     Assert.IsFalse(fraction.IsEqual(other));
 }