public void BuildWithOnlyEquitiesReturnsEmptyListForGivenEmptyList()
        {
            getStocksFunc = () => emptyStockSet;
            var sut = new SummaryBuilder(getStocksFunc);

            CollectionAssert.IsEmpty(sut.WithEquities().Build());
        }
        public void BuildWithEquitiesAndBondsReturnsATwoEntryList()
        {
            getStocksFunc = SetupFund(baseTestingStockSet);
            var sut = new SummaryBuilder(getStocksFunc);

            Assert.AreEqual(2, sut.WithEquities().WithBonds().Build().Count());
        }
        public void BuildWithEquitiesReturnsAListOfOne()
        {
            getStocksFunc = () => arbitraryStockSet;
            var sut = new SummaryBuilder(getStocksFunc);

            Assert.AreEqual(1, sut.WithEquities().Build().Count());
        }
        public void BuildWithEquitiesReturnsCorrectSummaryModel()
        {
            getStocksFunc = SetupFund(baseTestingStockSet);

            var sut    = new SummaryBuilder(getStocksFunc);
            var result = sut.WithEquities().Build().First();

            Assert.AreEqual("Equities", result.Name);
            Assert.AreEqual(3, result.TotalNumber);
            Assert.AreEqual(0.4m, result.TotalStockWeight);
        }
        public void BuildWithEquitiesAndBondsReturnsCorrectSummaryModel()
        {
            getStocksFunc = SetupFund(baseTestingStockSet);

            var sut      = new SummaryBuilder(getStocksFunc);
            var result   = sut.WithEquities().WithBonds().Build();
            var equities = result.First();

            Assert.AreEqual(0.4m, equities.TotalStockWeight);
            var bonds = result.ElementAt(1);

            Assert.AreEqual(0.6m, bonds.TotalStockWeight);
        }