public int GetCurrency(ECurrencyType currencyType) { switch (currencyType) { case ECurrencyType.Chip: return(_chip); case ECurrencyType.Core: return(_core); case ECurrencyType.Bit: return(_bit); default: return(-1); } }
public async Task GetAmountTest_inParameters(string amount, ECurrencyType curTypeFrom, string from, string to, ECurrencyType curTypeTo, string expected, decimal expDexAmount) { //Given var dAmount = Convert.ToDecimal(amount); var inputAmount = new CurrencyAmount(dAmount, curTypeFrom); var expAmount = new CurrencyAmount(expDexAmount, curTypeTo); _interactor.Setup(f => f.Convert(inputAmount, curTypeTo)) .Returns(Task.FromResult(expAmount)); //When var actual = await _presenter.GetAmount(amount, from, to); //Then Assert.AreEqual(expected, actual); _interactor.Verify(f => f.Convert(inputAmount, curTypeTo), Times.Once); }
public int TakeCurrency(ECurrencyType currencyType, int amount) { switch (currencyType) { case ECurrencyType.Chip: _chip -= amount; return(_chip); case ECurrencyType.Core: _core -= amount; return(_core); case ECurrencyType.Bit: _bit -= amount; return(_bit); default: return(-1); } }
public static string ToCultureStr(this ECurrencyType type) { string result = "en-us"; switch (type) { case ECurrencyType.USD: return("en-us"); case ECurrencyType.BRT: return("pt-br"); case ECurrencyType.EUR: return("es-ES"); case ECurrencyType.COL: return("es-CO"); } return(result); }
public CurrencyAmount(decimal amount, ECurrencyType currency) { Amount = amount; Currency = currency; }
public void AddCurrencyValue(ECurrencyType type, int addValue) { SetCurrencyValue(type, GetCurrencyValue(type) + addValue); }
public void SetCurrency(ECurrencyType currencyType, int value) { _currencyItem[(int)currencyType].SetAmount(value); }
public void SetCurrencyValue(ECurrencyType type, int value) { SetCurrencyValue((int)type, value); }
public int GetCurrencyValue(ECurrencyType type) { return(GetCurrencyValue((int)type)); }
public int GetMoneyCountOfType(ECurrencyType type) { return(_money.ContainsKey(type) ? _money[type] : 0); }
public async Task <decimal> GetRatio(ECurrencyType from, ECurrencyType to) { return(2M); }
public ChangeHistoryItem(ECurrencyType type, int quantity, int value) { Type = type; Quantity = quantity; Value = value; }