public void OnFundChanged() { var fundTotalItems = _fundService.AllTotals().Select(s => _stockConverter.Convert(EventAggregator, s)); FundSummaryItems = new List <IFundTotalItem>(fundTotalItems); OnPropertyChanged(() => FundSummaryItems); }
public void AddThreeStocksCheckTotalsNumberSuccess() { var request0 = new BaseStockModel() { Price = 1, Quantity = 1, Type = StockType.Equity }; var request1 = new BaseStockModel() { Price = 1, Quantity = 1, Type = StockType.Bond }; var request2 = new BaseStockModel() { Price = 1, Quantity = 1, Type = StockType.Bond }; _fundService.AddStock(request0); _fundService.AddStock(request1); _fundService.AddStock(request2); var allStocks = _fundService.AllStocks().ToArray(); AssertEvents(3); AssertStocksLength(allStocks, 3); AssertTotalMarketValueInStock(allStocks[0], new[] { request0, request1, request2 }); var allTotals = _fundService.AllTotals().ToArray(); Assert.That(allTotals.Length, Is.EqualTo(3)); Assert.That(allTotals.Count(t => t.Type == null), Is.EqualTo(1)); Assert.That(allTotals.Count(t => t.Type == StockType.Bond), Is.EqualTo(1)); Assert.That(allTotals.Count(t => t.Type == StockType.Equity), Is.EqualTo(1)); }