public void GivenGeneralLedgerAccount_WhenSettingDefaultCostCenter_ThenDefaultCostCenterMustBeInListOfAllowedCostCenters()
        {
            var costCenter = new CostCenterBuilder(this.Session).WithName("costCenter").Build();

            var glAccount = new GeneralLedgerAccountBuilder(this.Session)
                            .WithAccountNumber("0001")
                            .WithName("GeneralLedgerAccount")
                            .WithCostCenterAccount(true)
                            .WithCostCenterRequired(true)
                            .WithDefaultCostCenter(costCenter)
                            .WithBalanceSheetAccount(true)
                            .WithSide(new DebitCreditConstants(this.Session).Debit)
                            .WithGeneralLedgerAccountType(new GeneralLedgerAccountTypeBuilder(this.Session).WithDescription("accountType").Build())
                            .WithGeneralLedgerAccountGroup(new GeneralLedgerAccountGroupBuilder(this.Session).WithDescription("accountGroup").Build())
                            .Build();

            var derivationLog = this.Session.Derive(false);

            var expectedMessage = ErrorMessages.CostCenterNotAllowed;

            Assert.Equal(derivationLog.Errors[0].Message, expectedMessage);

            glAccount.AddCostCentersAllowed(costCenter);

            Assert.False(this.Session.Derive(false).HasErrors);
        }