public void Coins_For_ComboBoxCoins_Collections_AreSame() { //Arrange repo = new USCurrencyRepo(); vm = new RepoViewModel((USCurrencyRepo)repo); ObservableCollection <ICoin> testCoinsforcdCoins; //Act testCoinsforcdCoins = vm.CoinsForComboBox; var coinList = USCurrencyRepo.GetCoinList(); //Assert CollectionAssert.AreEqual(coinList, testCoinsforcdCoins); }
public override ICurrencyRepo GetOnlyCoinsOfType(Type coinType) { ICurrencyRepo originalRepo = this; ICurrencyRepo repo = new USCurrencyRepo(); foreach (ICoin c in originalRepo.Coins) { if (coinType == c.GetType()) { repo.AddCoin(c); } } return(repo); }
public void ExecuteCommandLoad(object parameter) { try { IFormatter formatter = new BinaryFormatter();//make the writer? Stream stream = File.Open(Path, FileMode.Open, FileAccess.Read, FileShare.Read); repo = (CurrencyRepo)formatter.Deserialize(stream);//I made this whole line up without looking at how to do this, let's see if it works stream.Close(); } catch (System.IO.FileNotFoundException e) { //Don't load anyhting if there's nothing to load } RaisePropertyChanged("CoinCount"); RaisePropertyChanged("CoinValue"); RaisePropertyChanged("CoinsInRepo"); }
public CurrenciesController(ICurrencyRepo repository, IMapper mapper) { _repository = repository; _mapper = mapper; }
public MakeChange(ICurrencyRepo repo) { InitializeComponent(); this.MakeChangeView1.DataContext = new MakeChangeViewModel(repo); }
public WindowRepo(ICurrencyRepo repo) { InitializeComponent(); this.WindowRepo1.DataContext = new CurrencyRepoViewModel(repo); }
public WindowMakeChange(CurrencyRepo repo) { this.repo = repo; InitializeComponent(); }
public RepoViewModel(ICurrencyRepo repo) { this.repo = repo; }
public void MakeChange(decimal Amount) { repo = USCurrencyRepo.MakeChange(Amount); }
public CurrencyRepoViewModel(ICurrencyRepo repo) { this.repo = repo; CoinsForcdCoins = new ObservableCollection <ICoin>(this.repo.CurrencyList); }
public override ICurrencyRepo Reduce() { ICurrencyRepo reduced = this.MakeChange(this.TotalValue()); return(reduced); }
public MakeChangeViewModel(ICurrencyRepo repo) { this.repo = repo; }
public MainWindow() { InitializeComponent(); repo = new USCurrencyRepo(); }
public UserControlGraphicViewModel(ICurrencyRepo repo) { this.repo = repo; CoinsforcdCoins = new ObservableCollection <ICoin>(((USCurrencyRepo)repo).Coins); }
public ControlGraphicWindow(ICurrencyRepo repo) { InitializeComponent(); this.GraphicWindow1.DataContext = new UserControlGraphicViewModel(repo); }
public TestController(IUserRepo _UserRepo, ICurrencyRepo _CurrencyRepo) { UserRepo = _UserRepo; CurrencyRepo = _CurrencyRepo; }
public RepoViewModel(ICurrencyRepo repo) { this.repo = repo; this.repo.Coins = new List <ICoin>(); }
public SaveableCurrencyRepo(ICurrencyRepo cr) { this.SavableCoins = cr.Coins; savelocation = "test.json"; }
private void UpdateMakeChange() { this.repo = repo.MakeChange(RepoTotal); RaisePropertyChangedEvent("Coins"); }
public CurrencyRepoController() { repo = new USCurrencyRepo(); //can we inject this? vm = new RepoViewModel(repo); }