public void Create_Tickets_DeductableAmmountIsCorrect(int ammount, int receiverCount, int expectedDeductableAmmount, int expectedDeductableVat, int expectedNonDeductableAmmount)
        {
            RepresentationSplitter representationSplitter = new RepresentationSplitter(ammount, 25, RepresentationType.TicketsEtc, receiverCount);

            Assert.AreEqual(expectedDeductableAmmount, representationSplitter.DeductableAmmount);
            Assert.AreEqual(expectedDeductableVat, representationSplitter.DeductableVat);
            Assert.AreEqual(expectedNonDeductableAmmount, representationSplitter.NonDeductableAmmount);
        }
Exemplo n.º 2
0
        public List<Expense> GetExpenses()
        {
            AccountType deductableAccount;
            AccountType nonDeductableAccount;

            RepresentationSplitter splitter = new RepresentationSplitter(Ammount, VatPercent, Type, Receivers.Count);

            switch (Circumstance)
            {
                case RepresentationCircumstance.Extern:
                    deductableAccount = AccountType.ExternRepresentationAvdragsgill;
                    nonDeductableAccount = AccountType.ExternRepresentationEjAvdragsgill;
                    break;
                case RepresentationCircumstance.Intern:
                    deductableAccount = AccountType.InternRepresentationAvdragsgill;
                    nonDeductableAccount = AccountType.InternRepresentationEjAvdragsgill;
                    break;
                case RepresentationCircumstance.Rekrytering:
                    deductableAccount = AccountType.RekryteringAvdragsgill;
                    nonDeductableAccount = AccountType.RekryteringEjAvdragsgill;
                    break;
                default:
                    return null;
            }

            var result = new List<Expense>
            {
                new Expense(deductableAccount, splitter.DeductableAmmount, splitter.DeductableVat)
            };

            if (splitter.NonDeductableAmmount > 0)
            {
                result.Add(new Expense(nonDeductableAccount, splitter.NonDeductableAmmount, 0));
            }

            return result;
        }