Example #1
0
        public void ObjectEqualityTests(double left, object right, bool expected)
        {
            Probability l = Probability.Create((decimal)left).Value;

            bool result = l.Equals(right);

            result.Should().Be(expected);
        }
Example #2
0
        public void EqualsTests(double left, double right, bool expected)
        {
            Probability l = Probability.Create((decimal)left).Value;
            Probability r = Probability.Create((decimal)right).Value;

            bool result = l.Equals(r);

            result.Should().Be(expected);
        }
Example #3
0
        public void LessThanEqualToTests(double left, double right, bool expected)
        {
            Probability l = Probability.Create((decimal)left).Value;
            Probability r = Probability.Create((decimal)right).Value;

            bool result = l <= r;

            result.Should().Be(expected);
        }
Example #4
0
        public void SubtractionTests(double left, double right, double expected)
        {
            Probability l = Probability.Create((decimal)left).Value;
            Probability r = Probability.Create((decimal)right).Value;

            Probability result = l - r;

            result.Chance.Should().Be((decimal)expected);
        }
Example #5
0
        public void CompareToTests(double left, double right, int expected)
        {
            Probability l = Probability.Create((decimal)left).Value;
            Probability r = Probability.Create((decimal)right).Value;

            int result = l.CompareTo(r);

            result.Should().Be(expected);
        }
Example #6
0
        public void ObjectIsEqual()
        {
            Probability left  = Probability.Create(1.0m).Value;
            Probability right = Probability.Create(1.0m).Value;
            object      obj   = (object)right;

            bool result = left.Equals(obj);

            result.Should().BeTrue();
        }