Ejemplo n.º 1
0
            public void ShouldHandleFractionCorrectly()
            {
                var first  = new SignedRational(-1.0 / 1600);
                var second = new SignedRational(-1.0 / 1600, true);

                Assert.False(first.Equals(second));
            }
Ejemplo n.º 2
0
        public void Test_Fraction()
        {
            SignedRational first  = new SignedRational(1.0 / 1600);
            SignedRational second = new SignedRational(1.0 / 1600, true);

            Assert.IsFalse(first.Equals(second));
        }
Ejemplo n.º 3
0
        public void Fraction()
        {
            var first  = new SignedRational(1.0 / 1600);
            var second = new SignedRational(1.0 / 1600, true);

            Assert.False(first.Equals(second));
        }
Ejemplo n.º 4
0
            public void ShouldReturnFalseWhenInstanceIsNotEqual()
            {
                var first  = new SignedRational(-3, 2);
                var second = new SignedRational(-2, 3);

                Assert.False(first.Equals(second));
            }
Ejemplo n.º 5
0
            public void ShouldReturnFalseWhenObjectIsNotEqual()
            {
                var first  = new SignedRational(-3, 2);
                var second = new SignedRational(-2, 3);

                Assert.False(first.Equals((object)second));
            }
Ejemplo n.º 6
0
            public void ShouldReturnTrueWhenInstanceIsEqual()
            {
                var first  = new SignedRational(-3, 2);
                var second = new SignedRational(-3, 2);

                Assert.True(first.Equals(second));
            }
Ejemplo n.º 7
0
            public void ShouldReturnTrueWhenObjectIsEqual()
            {
                var first  = new SignedRational(-3, 2);
                var second = new SignedRational(-3, 2);

                Assert.True(first.Equals((object)second));
            }
Ejemplo n.º 8
0
        public void Test_IEquatable()
        {
            SignedRational first = new SignedRational(3, 2);

            Assert.IsFalse(first.Equals(null));
            Assert.IsTrue(first.Equals(first));
            Assert.IsTrue(first.Equals((object)first));

            SignedRational second = new SignedRational(3, 2);

            Assert.IsTrue(first == second);
            Assert.IsTrue(first.Equals(second));
            Assert.IsTrue(first.Equals((object)second));

            second = new SignedRational(2, 3);

            Assert.IsTrue(first != second);
            Assert.IsFalse(first.Equals(second));
        }
Ejemplo n.º 9
0
    public void Test_IEquatable()
    {
      SignedRational first = new SignedRational(3, 2);

      Assert.IsFalse(first.Equals(null));
      Assert.IsTrue(first.Equals(first));
      Assert.IsTrue(first.Equals((object)first));

      SignedRational second = new SignedRational(3, 2);

      Assert.IsTrue(first == second);
      Assert.IsTrue(first.Equals(second));
      Assert.IsTrue(first.Equals((object)second));

      second = new SignedRational(2, 3);

      Assert.IsTrue(first != second);
      Assert.IsFalse(first.Equals(second));
    }
Ejemplo n.º 10
0
            public void ShouldReturnTrueWhenObjectIsTheSame()
            {
                var density = new SignedRational(-3, 2);

                Assert.True(density.Equals((object)density));
            }
Ejemplo n.º 11
0
            public void ShouldReturnTrueWhenInstanceIsTheSame()
            {
                var density = new SignedRational(-3, 2);

                Assert.True(density.Equals(density));
            }
Ejemplo n.º 12
0
            public void ShouldReturnFalseWhenInstanceIsNull()
            {
                var density = new SignedRational(-3, 2);

                Assert.False(density.Equals(null));
            }
Ejemplo n.º 13
0
 public void Test_Fraction()
 {
   SignedRational first = new SignedRational(1.0 / 1600);
   SignedRational second = new SignedRational(1.0 / 1600, true);
   Assert.IsFalse(first.Equals(second));
 }