public void CurrrencySelectedTotalTest() { var currencySelected = new CurrencySelected(); double total = currencySelected.CurrrencySelectedTotal(1, 1.5); Assert.AreEqual(1.5, total); }
public override View GetView(int position, View convertView, ViewGroup parent) { View row = convertView; if (row == null) { row = LayoutInflater.From(this._context).Inflate(Resource.Layout.ListView_row, root: null, attachToRoot: false); } Currency rowCurrency = _items[position]; TextView currencyCodeTextView = row.FindViewById <TextView>(Resource.Id.currencyCode); currencyCodeTextView.Text = rowCurrency.Code; TextView currencyNameTextView = row.FindViewById <TextView>(Resource.Id.currencyName); currencyNameTextView.Text = rowCurrency.Name; TextView currencySellTextView = row.FindViewById <TextView>(Resource.Id.youPay); currencySellTextView.Text = CurrencySelected.GetValueInCurrency(rowCurrency).ToString(); TextView currencyBuyTextView = row.FindViewById <TextView>(Resource.Id.youGet); currencyBuyTextView.Text = rowCurrency.GetValueInCurrency(CurrencySelected).ToString(); return(row); }
public void IndexTest() { var currencySelected = new CurrencySelected(); double total = currencySelected.CurrencySelectedTotal(1, 1.5); double total2 = currencySelected.CurrencySelectedTotal(4, 1.5); double total3 = currencySelected.CurrencySelectedTotal(4.5, 100000); double total4 = currencySelected.CurrencySelectedTotal(0, 0); double total5 = currencySelected.CurrencySelectedTotal(1, 2); Assert.IsNotNull(total); Assert.IsNotNull(total2); Assert.IsNotNull(total3); Assert.IsNotNull(total4); Assert.IsNotNull(total5); Assert.AreEqual(1.5, total); Assert.AreEqual(6, total2); Assert.AreEqual(450000, total3); Assert.AreEqual(0, total4); Assert.AreEqual(2, total5); }
private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { CurrencySelected?.Invoke(this, new CurrencySelectedEventArgs((CurrencyViewModel)e.SelectedItem)); Navigation.PopAsync(); }
private async void OnItemSelected(object sender, SelectedItemChangedEventArgs e) { CurrencySelected?.Invoke(this, new CurrencySelectedEventArgs(e.SelectedItem as Currency)); await Navigation.PopModalAsync(); }