예제 #1
0
        public void SetMarketValue_MultiplyPriceAndQuantity()
        {
            FundService fs    = new FundService();
            var         value = fs.SetMarketValue(10, 2);

            Assert.AreEqual(20, value);
        }
예제 #2
0
        public void SetStockWeight_DivideMVAndTotalSumOfAllMV()
        {
            FundService fs = new FundService();
            var         mv = fs.SetMarketValue(10, 1);
            var         sw = fs.SetStockWeight(mv, 10);

            Assert.AreEqual(1, sw);
        }
예제 #3
0
        public void SetTransactionCost_MultiplyMVandBondValue()
        {
            FundService fs    = new FundService();
            var         mv    = fs.SetMarketValue(10, 2);
            var         value = fs.SetTransactionCost(mv, Type.Bond);

            Assert.AreEqual(0.4, value);
        }
예제 #4
0
        public void SetTotalMarketValue_IfListIsEmptyReturnPriceMultiplyByQuantity()
        {
            var         funds       = new BindingList <Fund>();
            Operations  operations  = new Operations();
            FundService fundService = new FundService();

            var value = operations.SetTotalMarketValue(funds, fundService.SetMarketValue(10, 1));

            Assert.AreEqual(10, value);
        }