public ShellViewModel(AddSymbolViewModel addSymbol, SymbolsViewModel symbols, StatusViewModel status, AutoRefreshViewModel autoRefresh, QuotesViewModel quotes) { AddSymbol = addSymbol; Symbols = symbols; Status = status; Quotes = quotes; AutoRefresh = autoRefresh; }
public ShellViewModel( StockPricesViewModel stockPricesViewModel, AddSymbolViewModel addSymbolViewModel) { StockPricesViewModel = stockPricesViewModel; AddSymbolViewModel = addSymbolViewModel; AddSymbolViewModel.StockSymbolService = StockPricesViewModel; }
public void CanAddSymbol_ShouldBeCorrect(string symbol, bool expected) { // arrange // act var vm = new AddSymbolViewModel { Symbol = symbol }; // assert vm.AddSymbolCommand.CanExecute().ShouldBe(expected); }
[TestCase(false, true, "AAA", "")] // show public void Changing_IsVisible_ShouldResetSymbol(bool isVisibleInitialValue, bool isVisibleNextValue, string symbolInitialValue, string symbolExpectedValue) { // arrange var vm = new AddSymbolViewModel { IsVisible = isVisibleInitialValue, Symbol = symbolInitialValue }; // act vm.IsVisible = isVisibleNextValue; // assert vm.Symbol.ShouldBe(symbolExpectedValue); }
public void AddSymbol_ShouldCorrectlyAddSymbol(string symbol) { // arrange _stockSymbolService.Setup(x => x.AddSymbolAsync(It.Is <string>(s => s == symbol))); // act var vm = new AddSymbolViewModel { Symbol = symbol, StockSymbolService = _stockSymbolService.Object }; vm.AddSymbolCommand.Execute(); // assert _stockSymbolService.Verify(x => x.AddSymbolAsync(It.Is <string>(s => s == symbol))); vm.IsVisible.ShouldBe(false); }