InstaTax.Core.DomainObjects.OtherIncomes.GetItems C# (CSharp) Method

GetItems() public method

public GetItems ( ) : IEnumerable
return IEnumerable
        public IEnumerable<OtherIncomeItem> GetItems()
        {
            return otherIncomeItems;
        }

Usage Example

Exemplo n.º 1
0
        public void ShouldGetOtherIncomeItemsWhenItemsAreAdded()
        {
            OtherIncomes ois = new OtherIncomes();

            IList<OtherIncomeItem> items = new List<OtherIncomeItem>() { new OtherIncomeItem("Interet", 12000.0),  new OtherIncomeItem("Rental", 12000.0) };
            foreach (OtherIncomeItem otherIncomeItem in items)
            {
                ois.Add(otherIncomeItem);
            }

            Assert.AreEqual(24000.00m, ois.CalculateTotalAmount());
            Assert.IsNotNull(ois.GetItems());
            foreach (OtherIncomeItem otherIncomeItem in ois.GetItems())
            {
                Assert.IsTrue(items.Contains(otherIncomeItem));
            }
        }