Example #1
0
        public void And_should_return_the_product_of_the_inputs(decimal a, decimal b, decimal expected)
        {
            // arrange
            var A = new Probability(a);
            var B = new Probability(b);

            // act
            var actual = A.And(B);

            // assert
            actual.Should().BeEquivalentTo(new Probability(expected));
        }
        public async Task CombineWith_should_return_the_probability_of_A_and_B()
        {
            // arrange
            const decimal A = 0.5M;
            const decimal B = 0.5M;

            // act
            var actual = await GetSubject().CombineAWithB(new CalculationInput {
                A = A, B = B
            });

            // assert
            var a        = new Probability(A);
            var b        = new Probability(B);
            var expected = a.And(b).Value;

            actual.Result.Should().Be(expected);
        }