Exemple #1
0
        public async Task ShouldReturnSuccess_AfterHandle_CollateralsLessThanWithdrawalQuantity()
        {
            const string  securityId           = "12345";
            const decimal quantityInCollateral = 5000.231M;

            List <RIPE.Domain.Domains.Collateral> collaterals = CollateralFake.GetRealCollateralSameSecurityId(securityId, quantityInCollateral);

            _collateralRepository.GetCollateralPerSecurityId(Arg.Any <string>(), Arg.Any <string>()).Returns(collaterals);

            List <TypeQuestions> checkBoxes = new List <TypeQuestions>();

            Response <QuestionsResponse> response = await _handler.Handle(new CollateralExceededByValueQuery(checkBoxes), CancellationToken.None);

            response.IsSuccess.Should().BeTrue();
            response.Value.survey.Should().NotBeEmpty();
        }
Exemple #2
0
        public async Task ShouldReturnSuccess_AfterHandle_CollateralsLessThanWithdrawalQuantity()
        {
            const string securityId = "12345";
            //  const decimal securityQuantity = 10000.506M;
            // const decimal withdrawalQuantity = 6000.342M;
            const decimal quantityInCollateral = 5000.231M;
            const decimal expected             = 1000.07M;

            List <RIPE.Domain.Domains.Collateral> collaterals = CollateralFake.GetRealCollateralSameSecurityId(securityId, quantityInCollateral);

            _collateralRepository.GetCollateralPerSecurityId(Arg.Any <string>(), Arg.Any <string>()).Returns(collaterals);

            List <TypeQuestions>      checkBoxes = new List <TypeQuestions>();
            Response <ReportResponse> response   = await _handler.Handle(new ReportQuery(checkBoxes), CancellationToken.None);

            response.IsSuccess.Should().BeTrue();
            response.Value.ExceededQuantity.Should().Be(expected);
        }