public void ConvertTest3() { APIHandler api = new APIHandler(); List <CurrencyDTO> list = api.GetCurrenciesDTO(); Double response = api.Convert("CHF", "EUR", 1, list); Assert.IsTrue(response < 1); }
public void ConvertTest() { APIHandler api = new APIHandler(); List <CurrencyDTO> list = api.GetCurrenciesDTO(); Double selectedQuantity = 10; Double response = api.Convert("EUR", "USD", selectedQuantity, list); Assert.IsTrue(response > selectedQuantity); }
async void OnConvertClicked(object sender, EventArgs e) { Wallet currencyAppItem = (Wallet)BindingContext; Double selectedQuantity = currencyAppItem.Quantity; currencyAppItem.Quantity = oldQuantity; string toSymbol = (string)Picker.SelectedItem; // convert await APIHandler.Convert(currencyAppItem.Symbol, toSymbol, currencyAppItem, selectedQuantity); await Navigation.PopToRootAsync(); }
async void OnConvertClicked(object sender, EventArgs e) { Wallet JanusItem = (Wallet)BindingContext; Double selectedQuantity = JanusItem.Quantity; JanusItem.Quantity = oldQuantity; string toSymbol = (string)Picker.SelectedItem; // convert if (selectedQuantity > 0) { await APIHandler.Convert(JanusItem.Symbol, toSymbol, JanusItem, selectedQuantity); await Navigation.PopToRootAsync(); } }
async void OnConvert() { try { string toSymbol = (string)Currency.SelectedItem; //Get Wallets List <Wallet> wallets = await App.Database.GetItemsAsync(); foreach (Wallet wallet in wallets) { await APIHandler.Convert(wallet.Symbol, toSymbol, wallet, wallet.Quantity); } } catch (Exception ex) { Debug.WriteLine(ex.StackTrace); } await Navigation.PopToRootAsync(); }