예제 #1
0
        public void CalculateMandates_CodeMatchFound()
        {
            MandatesService mandatesService = new MandatesService();

            List <Position>       position       = CreateMockPositionVM();
            List <FundOfMandates> fundOfMandates = CreateMockFundOfMandates();

            var result = mandatesService.CalculateMandates(position, fundOfMandates);

            result.Should().NotBeEmpty("Code Mandates found", result);
        }
예제 #2
0
        public void CalculateMandates_CodeMatchNotFound()
        {
            MandatesService mandatesService = new MandatesService();

            List <Position>       position       = CreateMockPositionVM_NoCodeMatch();
            List <FundOfMandates> fundOfMandates = CreateMockFundOfMandates();

            var result = mandatesService.CalculateMandates(position, fundOfMandates);

            result[0].Mandates.Should().BeNull("Code Mandates not found", result[0].Mandates);
        }
예제 #3
0
        public void CalculateMandates_LiquidityAllocation_GreaterThanZero()
        {
            MandatesService mandatesService = new MandatesService();

            List <Position>       position       = CreateMockPositionVM();
            List <FundOfMandates> fundOfMandates = CreateMockFundOfMandates();

            var result = mandatesService.CalculateMandates(position, fundOfMandates);

            result[1].Mandates.Should().HaveCount(4, "Liquidity Mandate Found.");
        }
예제 #4
0
        public void CalculateMandates_Null_Positions_Parameter()
        {
            MandatesService mandatesService = new MandatesService();

            List <Position>       position       = null;
            List <FundOfMandates> fundOfMandates = CreateMockFundOfMandates();

            Action act = () => mandatesService.CalculateMandates(position, fundOfMandates);

            act.Should().Throw <ArgumentNullException>()
            .And.Message.Should().Be("Parameter can not be null (Parameter 'positions')");
        }