示例#1
0
        public void GetPortionWithSmallestReminder_OneAsset()
        {
            var allocation = new AssetAllocation(new AssetPortion("AGG", 1.0M));

            var assetSize = allocation.GetAssetWithSmallestReminder(30.Dollars(), _prices);

            Assert.Equal("AGG", assetSize.Ticker);
            Assert.Equal(1, assetSize.Size);
        }
示例#2
0
        public void GetPortionWithSmallestReminder_PortfolioCostIsTooSmall()
        {
            var allocation = new AssetAllocation(new AssetPortion("AGG", 1.0M));

            var assetSize = allocation.GetAssetWithSmallestReminder(10.Dollars(), _prices);

            Assert.Equal("AGG", assetSize.Ticker);
            Assert.Equal(0, assetSize.Size);
        }
示例#3
0
        public void GetPortionWithSmallestReminder_SeveralAssets()
        {
            var allocation = new AssetAllocation(
                new AssetPortion("AGG", 0.55M),
                new AssetPortion("VTT", 0.45M));

            var assetSize = allocation.GetAssetWithSmallestReminder(100.Dollars(), _prices);

            Assert.Equal("VTT", assetSize.Ticker);
            Assert.Equal(3, assetSize.Size);
        }