Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
 public void ScaricaPortafoglio_IndirizzoErrato_Eccezione()
 {
     EthereumEtherscan blockexplorer = new EthereumEtherscan("blabla", factory);
     Portafoglio       ris           = blockexplorer.ScaricaPortafoglio().Result;
 }
Ejemplo n.º 7
0
 public void Costruttore_FactoryNull_Eccezione()
 {
     EthereumEtherscan explorer = new EthereumEtherscan("0x9065496049506905486094569045", null);
 }
Ejemplo n.º 8
0
 public void Costruttore_IndirizzoVuoto_Eccezione()
 {
     EthereumEtherscan explorer = new EthereumEtherscan("", factory);
 }
Ejemplo n.º 9
0
 public void Costruttore_SenzaIndirizzo_Eccezione()
 {
     EthereumEtherscan explorer = new EthereumEtherscan(null, factory);
 }