public void GivenGeneralLedgerAccount_WhenSettingDefaultCostUnit_ThenDefaultCostUnitMustBeInListOfAllowedCostUnits()
        {
            var costUnit = new Goods(this.Session).FindBy(M.Good.Name, "good1");

            var glAccount = new GeneralLedgerAccountBuilder(this.Session)
                            .WithAccountNumber("0001")
                            .WithName("GeneralLedgerAccount")
                            .WithCostUnitAccount(true)
                            .WithCostUnitRequired(true)
                            .WithDefaultCostUnit(costUnit)
                            .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.CostUnitNotAllowed;

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

            glAccount.AddCostUnitsAllowed(costUnit);

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