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);
        }
        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);
        }
        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);
        }