Наследование: DividendTransaction
Пример #1
0
        public void ShouldCreateUnitDividendTransactionForMutualFund()
        {
            var firstOfJan2008 = new DateTime(2008, 1, 1);

            var selectedMutualFund = new MutualFund(null, null, null, "SUNMF", "SUN Magma", "Growth");
            var expectedTransaction = new UnitDividendTransaction(selectedMutualFund,
                                                                  100,
                                                                  firstOfJan2008);

            UnitDividendTransaction actualTransaction =
                selectedMutualFund.CreateUnitDividendTransaction(100,
                                                                 firstOfJan2008);
            Assert.AreEqual(expectedTransaction.Quantity, actualTransaction.Quantity);
            Assert.AreEqual(expectedTransaction.Instrument, actualTransaction.Instrument);
            Assert.AreEqual(expectedTransaction.Date, actualTransaction.Date);
        }
Пример #2
0
        public void ShouldIncludeUnitDividendWhileGettingCurrentMarketValueOfInstrument()
        {
            Instrument instrument = new MutualFund(new Symbol("RILMF"), new Price(100.00), "Reliance Mutual Fund", "SUNMF", "SUN Magma", "Growth");

            Transaction transaction1 = new BuyTransaction(new DateTime(2009, 09, 09), instrument, 10, new Price(100.00), 10, 10);
            Transaction transaction2 = new SellTransaction(new DateTime(2009, 09, 10), instrument, 5, new Price(200.00), 10, 10);
            Transaction transaction3 = new UnitDividendTransaction(instrument, 5, new DateTime(2009, 09, 10));

            List<Transaction> listTransaction = new List<Transaction>();
            listTransaction.Add(transaction1);
            listTransaction.Add(transaction2);
            Assert.AreEqual(500.00, instrument.CurrentMarketValue(listTransaction).Value);
            listTransaction.Add(transaction3);

            Assert.AreEqual(1000.00, instrument.CurrentMarketValue(listTransaction).Value);
        }
Пример #3
0
 public virtual bool Equals(UnitDividendTransaction other)
 {
     return base.Equals(other);
 }