public IEnumerable<IRendering> ProduceOffer(MortgageApplication application)
        {
            yield return new BoldRendering("Primary applicant:");

            var p = new ApplicantProcessor();
            foreach (var r in p.ProduceRenderings(application.PrimaryApplicant))
                yield return r;
        }
Esempio n. 2
0
        public void SutEqualsOther()
        {
            var sut = new ApplicantProcessor();
            var other = new ApplicantProcessor();

            var actual = sut.Equals(other);

            Assert.True(actual);
        }
Esempio n. 3
0
        public void SutDoesNotEqualAnonymousObject()
        {
            var sut = new ApplicantProcessor();
            var anonymous = new object();

            var actual = sut.Equals(anonymous);

            Assert.False(actual);
        }
Esempio n. 4
0
        public IEnumerable <IRendering> ProduceOffer(MortgageApplication application)
        {
            yield return(new BoldRendering("Primary applicant:"));

            var p = new ApplicantProcessor();

            foreach (var r in p.ProduceRenderings(application.PrimaryApplicant))
            {
                yield return(r);
            }
        }
        public IEnumerable<IRendering> ProduceOffer(MortgageApplication application)
        {
            yield return new BoldRendering("Additional applicants:");
            yield return new LineBreakRendering();

            var p = new ApplicantProcessor();

            foreach (var a in application.AdditionalApplicants)
            {
                yield return new BulletRendering("");
                foreach (var r in p.ProduceRenderings(a))
                    yield return r;
            }
        }
        public IEnumerable <IRendering> ProduceOffer(MortgageApplication application)
        {
            yield return(new BoldRendering("Additional applicants:"));

            yield return(new LineBreakRendering());

            var p = new ApplicantProcessor();

            foreach (var a in application.AdditionalApplicants)
            {
                yield return(new BulletRendering(""));

                foreach (var r in p.ProduceRenderings(a))
                {
                    yield return(r);
                }
            }
        }
Esempio n. 7
0
        public void ProduceRenderingsReturnsCorrectResult(
            string name,
            string street,
            string postalCode,
            string country,
            int yearlyIncome,
            string taxAuthority)
        {
            var sut = new ApplicantProcessor();
            var applicant = new Applicant
            {
                Contact = new Contact
                {
                    Name = name,
                    Address = new Address
                    {
                        Street = street,
                        PostalCode = postalCode,
                        Country = country
                    }
                },
                YearlyIncome = yearlyIncome,
                TaxationAuthority = taxAuthority
            };

            IEnumerable<IRendering> actual = sut.ProduceRenderings(applicant);

            var expected = new IRendering[]
            {
                new TextRendering(
                    " " +
                    name + ", " +
                    street + ", " +
                    postalCode + ", " +
                    country + ". "),
                new BoldRendering("Yearly income:"),
                new TextRendering(" " + yearlyIncome + ". "),
                new BoldRendering("Tax authority:"),
                new TextRendering(" " + taxAuthority + "."),
                new LineBreakRendering()
            };
            Assert.Equal(expected, actual);
        }