public UpdatedCurrencies UpdateCurrencies( CantorWallet cantorWallet, IEnumerable <Currency> currencies, UpdatedCurrencies updatedCurrencies) { ValidateCantorWaller(cantorWallet); cantorWallet.PublicationDate = updatedCurrencies.PublicationDate; foreach (var currency in currencies) { var updatedCurrency = FindCurrency(updatedCurrencies, currency.Name); UpdateCurrency(currency, updatedCurrency); updatedCurrencies.Items.Remove(updatedCurrency); } return(updatedCurrencies); }
private Currency FindCurrency(UpdatedCurrencies updatedCurrencies, string currencyName) { return(updatedCurrencies.Items .FirstOrDefault(p => p.Name == currencyName)); }
private bool ShouldUpdateCurrencies(CantorWallet cantorWallet, UpdatedCurrencies updatedCurrencies) { return(cantorWallet.PublicationDate != updatedCurrencies.PublicationDate); }