public void AddIdentity_Throws_WhenNoExistingFormForIdentity()
        {
            var coc = new ChangeOfCircsBuilder("form").Insert();

            Assert.Throws <DomainException>(() =>
                                            coc.AddIdentity("*****@*****.**"));
        }
        public void AddIdentity_StoresBsgDetail()
        {
            var existingForm = new BestStartGrantBuilder("existing_form")
                               .WithCompletedSections()
                               .With(f => f.UserId, "*****@*****.**")
                               .Insert(f =>
            {
                f.ApplicantDetails.Title                = "tst_title";
                f.ApplicantDetails.FirstName            = "tst_fn";
                f.ApplicantDetails.OtherNames           = "tst_on";
                f.ApplicantDetails.SurnameOrFamilyName  = "tst_sn";
                f.ApplicantDetails.CurrentAddress.Line1 = "al1";
                f.ApplicantDetails.MobilePhoneNumber    = "123";
                f.ApplicantDetails.PhoneNumer           = "234";
                f.ApplicantDetails.EmailAddress         = "[email protected]";

                f.PaymentDetails.HasBankAccount = true;
                f.PaymentDetails.AccountNumber  = "12345";
                f.PaymentDetails.SortCode       = "12-34-56";
            });

            var coc = new ChangeOfCircsBuilder("form").Insert();

            coc.AddIdentity("*****@*****.**");

            coc.ExistingApplicantDetails.Title.Should().Be("tst_title");
            coc.ExistingApplicantDetails.FullName.Should().Be("tst_fn tst_on tst_sn");
            coc.ExistingApplicantDetails.Address.Line1.Should().Be("al1");
            coc.ExistingApplicantDetails.MobilePhoneNumber.Should().Be("123");
            coc.ExistingApplicantDetails.HomePhoneNumer.Should().Be("234");
            coc.ExistingApplicantDetails.EmailAddress.Should().Be("[email protected]");

            coc.ExistingPaymentDetails.HasBankAccount.Should().BeTrue();
            coc.ExistingPaymentDetails.AccountNumber.Should().BeNull();
            coc.ExistingPaymentDetails.SortCode.Should().BeNull();
        }