Esempio 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);
            }
        }
Esempio n. 2
0
        public void ScaricaPortafoglio_IndirizzoStabile_Valore()
        {
            String               indirizzoStabile = "1JaPNwMXt2AuVkWmkUHbsw78MbGorTfmm2";
            Valuta               bitcoin          = factory.OttieniValuta("BTC");
            Fondo                fondo            = new Fondo(bitcoin, (decimal)2194.51101);
            Portafoglio          atteso           = new Portafoglio(indirizzoStabile, fondo);
            BitcoinBlockexplorer blockexplorer    = new BitcoinBlockexplorer(indirizzoStabile, factory);
            Portafoglio          ris = blockexplorer.ScaricaPortafoglio().Result;

            Assert.AreEqual <Portafoglio>(ris, atteso);
        }
Esempio 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);
 }
Esempio 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);
        }
Esempio n. 5
0
        private void SalvaBitcoinBtn_Click(object sender, RoutedEventArgs e)
        {
            string indirizzo = BitcoinTxt.Text;

            try
            {
                BitcoinBlockexplorer bitcoin = new BitcoinBlockexplorer(indirizzo, valutaFactory);
                if (gestoreFondi.AggiungiBlockchain(bitcoin))
                {
                    GestoreImpostazioni.SalvaDatiBlockchain(bitcoin);
                    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);
            }
        }
Esempio n. 6
0
 public void ScaricaPortafoglio_IndirizzoErrato_Eccezione()
 {
     BitcoinBlockexplorer blockexplorer = new BitcoinBlockexplorer("blabla", factory);
     Portafoglio          ris           = blockexplorer.ScaricaPortafoglio().Result;
 }
Esempio n. 7
0
 public void Costruttore_FactoryNull_Eccezione()
 {
     BitcoinBlockexplorer explorer = new BitcoinBlockexplorer("asdff2f23f3qr32r2rq23r2vrq23vr", null);
 }
Esempio n. 8
0
 public void Costruttore_IndirizzoVuoto_Eccezione()
 {
     BitcoinBlockexplorer explorer = new BitcoinBlockexplorer("", factory);
 }
Esempio n. 9
0
 public void Costruttore_SenzaIndirizzo_Eccezione()
 {
     BitcoinBlockexplorer explorer = new BitcoinBlockexplorer(null, factory);
 }