public CurrencyViewModel( IInitializationFacade initializationFacade, CurrencyDescriptionHelper currencyDescriptionHelper) { _initializationFacade = initializationFacade; _currencyDescriptionHelper = currencyDescriptionHelper; CurrencyRates = new ObservableCollection <Rate>(); PrepareDataAsync(); }
public void Setup() { var dictionary = new Dictionary <string, decimal>(); dictionary.Add("USD", new decimal(1.3)); dictionary.Add("PLN", new decimal(4.3)); _dictionarySize = dictionary.Count; var mockInitializationFacade = new Mock <IInitializationFacade>(MockBehavior.Strict); mockInitializationFacade.Setup(f => f.GetData()).ReturnsAsync(new Currency { Base = "EUR", Date = DateTime.Now, Rates = dictionary }); var initializationFacade = mockInitializationFacade.Object; var currencyDescriptionHelper = new CurrencyDescriptionHelper(); _testingViewModel = new CurrencyViewModel(initializationFacade, currencyDescriptionHelper); }