private void CaricaApi() { BinanceExchange binance = GestoreImpostazioni.LeggiDatiExchange <BinanceExchange>(valutaFactory); if (binance != null) { gestoreFondi.AggiungiExchange(binance); } BitfinexExchange bitfinex = GestoreImpostazioni.LeggiDatiExchange <BitfinexExchange>(valutaFactory); if (bitfinex != null) { gestoreFondi.AggiungiExchange(bitfinex); } BitcoinBlockexplorer bitcoin = GestoreImpostazioni.LeggiDatiBlockchain <BitcoinBlockexplorer>(valutaFactory); if (bitcoin != null) { gestoreFondi.AggiungiBlockchain(bitcoin); } EthereumEtherscan ethereum = GestoreImpostazioni.LeggiDatiBlockchain <EthereumEtherscan>(valutaFactory); if (ethereum != null) { gestoreFondi.AggiungiBlockchain(ethereum); } }
public void ScaricaPortafoglio_IndirizzoStabile_Valore() { String indirizzoStabile = "0x901476A5a3C504398967C745F236124201298016"; Valuta ethereum = factory.OttieniValuta("ETH"); Fondo fondo = new Fondo(ethereum, (decimal)3.129570488777777777); Portafoglio atteso = new Portafoglio(indirizzoStabile, fondo); EthereumEtherscan blockexplorer = new EthereumEtherscan(indirizzoStabile, factory); Portafoglio ris = blockexplorer.ScaricaPortafoglio().Result; Assert.AreEqual <Portafoglio>(ris, atteso); }
public GestoreFondiTests() { convertitore = new CryptoCompareConvertitore(); valutaFactory = new ValutaFactory(convertitore); gestoreFondi = new GestoreFondi(); bitfinex = new BitfinexExchange("5RMqfG7b2qOBkoPIi97UjCpPxnIhAUsDMelbT5K3pB2", "hnQNJgD80w1WJeZW7zclyJvFkTWNSN0N4r98t7oRrWw", valutaFactory); binance = new BinanceExchange("VhP4edkGMEmL51YSIXSdva0IkcGxC68r8dOIGg6G5PcNMr3srPcm4rXEled5KeMs", "1ET6MkbrkS2U1sIvQDu6gDzYzNuYgPX2ujG2Lt8tL5SFTygMKUeyDRFDJPT8Ry6Y", valutaFactory); btc = new BitcoinBlockexplorer("18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX", valutaFactory); eth = new EthereumEtherscan("0x901476A5a3C504398967C745F236124201298016", valutaFactory); }
private void TestInizializza() { BitfinexExchange bitfinex = new BitfinexExchange("5RMqfG7b2qOBkoPIi97UjCpPxnIhAUsDMelbT5K3pB2", "hnQNJgD80w1WJeZW7zclyJvFkTWNSN0N4r98t7oRrWw", valutaFactory); gestoreFondi.AggiungiExchange(bitfinex); BinanceExchange binance = new BinanceExchange("VhP4edkGMEmL51YSIXSdva0IkcGxC68r8dOIGg6G5PcNMr3srPcm4rXEled5KeMs", "1ET6MkbrkS2U1sIvQDu6gDzYzNuYgPX2ujG2Lt8tL5SFTygMKUeyDRFDJPT8Ry6Y", valutaFactory); gestoreFondi.AggiungiExchange(binance); BitcoinBlockexplorer btc = new BitcoinBlockexplorer("18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX", valutaFactory); gestoreFondi.AggiungiBlockchain(btc); EthereumEtherscan eth = new EthereumEtherscan("0x901476A5a3C504398967C745F236124201298016", valutaFactory); gestoreFondi.AggiungiBlockchain(eth); }
private void SalvaEthereumBtn_Click(object sender, RoutedEventArgs e) { string indirizzo = EthereumTxt.Text; try { EthereumEtherscan ethereum = new EthereumEtherscan(indirizzo, valutaFactory); if (gestoreFondi.AggiungiBlockchain(ethereum)) { GestoreImpostazioni.SalvaDatiBlockchain(ethereum); MessageBox.Show("Indirizzo salvato. Avviato aggiornamento fondi"); Dispatcher.BeginInvoke(new Action(async() => { await AggiornaFondi(); })); } else { MessageBox.Show("Esiste già un indirizzo associato, rimuoverlo prima di aggiungerne un altro."); } } catch (ArgumentException eccezione) { MessageBox.Show(eccezione.Message); } }
public void ScaricaPortafoglio_IndirizzoErrato_Eccezione() { EthereumEtherscan blockexplorer = new EthereumEtherscan("blabla", factory); Portafoglio ris = blockexplorer.ScaricaPortafoglio().Result; }
public void Costruttore_FactoryNull_Eccezione() { EthereumEtherscan explorer = new EthereumEtherscan("0x9065496049506905486094569045", null); }
public void Costruttore_IndirizzoVuoto_Eccezione() { EthereumEtherscan explorer = new EthereumEtherscan("", factory); }
public void Costruttore_SenzaIndirizzo_Eccezione() { EthereumEtherscan explorer = new EthereumEtherscan(null, factory); }