Beispiel #1
0
        public static ApplicantDetails NewValid(Action <ApplicantDetails> mutator = null)
        {
            var value = new ApplicantDetails
            {
                Title                   = "test title",
                FirstName               = "test first name",
                OtherNames              = "test other names",
                SurnameOrFamilyName     = "test surname or family name",
                DateOfBirth             = DomainRegistry.NowUtc().Date.AddYears(-19),
                PreviouslyLookedAfter   = false,
                FullTimeEducation       = false,
                NationalInsuranceNumber = "AB123456C",
                CurrentAddress          = AddressBuilder.NewValid("applicant"),
                EmailAddress            = "*****@*****.**",
                PhoneNumer              = "01234 567 890",
                MobilePhoneNumber       = "12345 678 901",
            };

            if (mutator != null)
            {
                mutator(value);
            }

            return(value);
        }
        public void CopyTo_OnlyCopiesUninheritedAddress()
        {
            var src = RelationDetailsBuilder.NewValid(rd =>
            {
                rd.InheritAddress = true;
                rd.Address        = AddressBuilder.NewValid();
            });

            var dest = new RelationDetails();

            src.CopyTo(dest);

            dest.InheritAddress.Should().BeTrue();
            dest.Address.Should().BeNull();
        }
Beispiel #3
0
        public static ApplicantDetails NewValid(Action <ApplicantDetails> mutator = null)
        {
            var value = new ApplicantDetails
            {
                Title             = "test title",
                FullName          = "test full name",
                Address           = AddressBuilder.NewValid("applicant"),
                MobilePhoneNumber = "12345 678 901",
                HomePhoneNumer    = "01234 567 890",
                EmailAddress      = "*****@*****.**",
            };

            if (mutator != null)
            {
                mutator(value);
            }

            return(value);
        }
        public static RelationDetails NewValid(string relation = "relation ", Action <RelationDetails> mutator = null)
        {
            var value = new RelationDetails
            {
                Title                   = "relation title",
                FullName                = "relation name",
                DateOfBirth             = DomainRegistry.NowUtc().Date.AddYears(-45),
                NationalInsuranceNumber = "BC123456D",
                RelationshipToApplicant = "Parent",

                InheritAddress = false,
                Address        = AddressBuilder.NewValid(relation),
            };

            if (mutator != null)
            {
                mutator(value);
            }

            return(value);
        }
Beispiel #5
0
        public ChangeOfCircsBuilder WithCompletedSections(bool markAsCompleted = true, bool excludeOptionalSections = false)
        {
            With(f => f.Consent, ConsentBuilder.NewValid());
            With(f => f.UserId, "*****@*****.**");
            With(f => f.ExistingApplicantDetails, ApplicantDetailsBuilder.NewValid(ad => ad.Address = AddressBuilder.NewValid("existing")));
            With(f => f.ExistingPaymentDetails, PaymentDetailsBuilder.NewValid());
            With(f => f.Options, OptionsBuilder.NewValid());

            if (!excludeOptionalSections)
            {
                With(f => f.ApplicantDetails, ApplicantDetailsBuilder.NewValid());
                With(f => f.ExpectedChildren, ExpectedChildrenBuilder.NewValid());
                With(f => f.HealthProfessional, HealthProfessionalBuilder.NewValid());
                With(f => f.PaymentDetails, PaymentDetailsBuilder.NewValid());
            }

            With(f => f.Evidence, EvidenceBuilder.NewValid());
            With(f => f.Declaration, DeclarationBuilder.NewValid());

            With(f => f.Started, DomainRegistry.NowUtc() - TimeSpan.FromHours(24));
            With(f => f.Completed, DomainRegistry.NowUtc());
            VerifyConsistent(_instance);

            if (!markAsCompleted)
            {
                With(f => f.Completed, null);
            }

            return(this);
        }