Ejemplo n.º 1
0
        public void TestCtor()
        {
            var testSubject = new AmericanAssets();

            Assert.IsNotNull(testSubject.MyItems);
            Assert.AreEqual(0, testSubject.MyItems.Count);

            //var futures =
            //    NamedReceivable.RandomNamedReceivalbleWithHistoryToSum("Futures", "Securities", 9000D.ToPecuniam());
            //testSubject.AddItem(futures);

            testSubject.AddItem("Futures", "Securities", 9000D.ToPecuniam());
            var testResultSum = testSubject.Total;

            Assert.IsNotNull(testResultSum);
            Assert.AreNotEqual(Pecuniam.Zero, testResultSum);
            Assert.AreEqual(9000D.ToPecuniam(), testResultSum);

            var stocks =
                NamedTradeline.RandomNamedTradelineWithHistoryToSum("Stocks", "Securities", 2000D.ToPecuniam());

            testSubject.AddItem(stocks);

            testResultSum = testSubject.Total.GetWholeNumber();
            Assert.AreNotEqual(Pecuniam.Zero, testResultSum);
            Assert.AreEqual(11000D.ToPecuniam(), testResultSum);
        }
Ejemplo n.º 2
0
        public void TestAddItems()
        {
            var testSubject = new AmericanAssets();
            var testResult  = testSubject.Total;

            Assert.AreEqual(Pecuniam.Zero, testResult);


            testSubject.AddItem("Home", null, 120000.0D);
            testResult = testSubject.Total;
            Assert.AreEqual(120000.0D.ToPecuniam(), testResult);

            testSubject.AddItem("Car", null, 25000);
            testResult = testSubject.Total;
            Assert.AreEqual((120000.0D + 25000).ToPecuniam(), testResult);
        }