Ejemplo n.º 1
0
        public void Given1Cr1DrAndBothADandEADExist_WhenGetPrimeCreditIsCalled_ThenOnlyCrIsReturnedAsPrimeCredit()
        {
            var vouchers = new List<VoucherInformation>();

            var expectedPrimeCredit =
                new VoucherInformationBuilder().WithVoucher(
                    new VoucherBuilder().WithCreditDocumentType().Build()).Build();

            vouchers.Add(new VoucherInformationBuilder().Build());
            vouchers.Add(expectedPrimeCredit);

            var primeCreditHelper = new RequestConverterHelper();

            var actualPrimeCredit = primeCreditHelper.GetPrimeCredit(vouchers);

            Assert.AreEqual(expectedPrimeCredit, actualPrimeCredit);
        }
Ejemplo n.º 2
0
        public void GivenHighValueCreditWithAltAuxDomIsTheLastCredit_WhenGetPrimeCreditIsCalled_ThenLastCrIsReturnedAsPrimeCredit()
        {
            var vouchers = new List<VoucherInformation>();

            var expectedPrimeCredit =
                new VoucherInformationBuilder()
                    .WithVoucher(new VoucherBuilder().WithCreditDocumentType().Build())
                    .WithVoucherProcess(new VoucherProcessBuilder()
                        .WithHighValueFlag()
                        .WithAlternateAuxDom("111111")
                        .Build())
                .Build();

            vouchers.Add(new VoucherInformationBuilder().Build());
            vouchers.Add(new VoucherInformationBuilder()
                    .WithVoucher(new VoucherBuilder().WithCreditDocumentType().Build()).Build());
            vouchers.Add(expectedPrimeCredit);

            var primeCreditHelper = new RequestConverterHelper();

            var actualPrimeCredit = primeCreditHelper.GetPrimeCredit(vouchers);

            Assert.AreEqual(expectedPrimeCredit, actualPrimeCredit);
        }
Ejemplo n.º 3
0
        public void Given1Dr2CrAnd1stCrHasEadAnd2ndCrHasAd_WhenGetPrimeCreditIsCalled_Then1stCrIsReturnedAsPrimeCredit()
        {
            var vouchers = new List<VoucherInformation>();

            var expectedPrimeCredit =
                new VoucherInformationBuilder().WithVoucher(
                    new VoucherBuilder().WithCreditDocumentType().WithEAD("222").Build()).Build();

            vouchers.Add(new VoucherInformationBuilder().Build());
            vouchers.Add(new VoucherInformationBuilder().WithVoucher(
                    new VoucherBuilder().WithCreditDocumentType().WithAD("111").Build()).Build());
            vouchers.Add(expectedPrimeCredit);

            var primeCreditHelper = new RequestConverterHelper();

            var actualPrimeCredit = primeCreditHelper.GetPrimeCredit(vouchers);

            Assert.AreEqual(expectedPrimeCredit, actualPrimeCredit);
        }