public void MemoryExecutionContextTest1()
        {
            MemoryExecutionContext ctx = new MemoryExecutionContext(new FakeLogger());

            ctx.setSessionValue<int>("i1", 12);
            //Assert.AreEqual<int>(12, ctx.getSessionValue<int>("i1"));
        }
        private void btnConnect_Click(object sender, EventArgs e)
        {
            //Se non si è loggati si connette
            if (!logged)
            {
                if (cmbAccount.SelectedItem != null)
                {
                    //Messaggio Connessione
                    lblStatusConnection.Text = "Login in corso...";

                    //Istanza Servizio NetSuite
                    service = new NetSuiteService();

                    //Lettura Credenziali
                    string account = cmbAccount.SelectedItem.ToString();
                    string email = txtEmail.Text;
                    string password = txtPassword.Text;

                    MemoryExecutionContext ctx = new MemoryExecutionContext(logger);
                    ctx.setSessionValue<NetSuiteService>("svcNS",service);

                    //Ricerca Url WebService
                    DataCenterAwareNetSuiteService DataCenter_Url = new DataCenterAwareNetSuiteService(account);
                    service.Url = DataCenter_Url.Url;
                    service.AllowAutoRedirect = true;
                    service.CookieContainer = new System.Net.CookieContainer();

                    //Connessione
                    Passport passport = new Passport();
                    passport.account = account;
                    passport.email = email;
                    passport.password = password;
                    try
                    {
                        Status status = service.login(passport).status;

                        //Connessione Riuscita Con Successo
                        panelLogin.BackColor = Color.LightGreen;

                        logged = true;

                        lblStatusConnection.Text = "Connesso";

                        btnConnect.Text = "Disconnect";

                        //Abilito Comandi Programma
                        EnableControls(this);
                        btnStart.Enabled = false;
                    }
                    catch (SoapException ex)
                    {
                        panelLogin.BackColor = Color.Red;
                        lblStatusConnection.Text = "Connessione non riuscita! " + ex.Message;
                    }
                }
                else
                    MessageBox.Show("Seleziona l'Account !");
            }
            else
            {
                //Logout NetSuite
                service.logout();
                //Disabilito comandi Programma se non Connesso
                DisableControls(this);

                logged = false;
                panelLogin.BackColor = Color.Transparent;

                btnConnect.Text = "Connect";
                lblStatusConnection.Text = "Non Connesso";
                txtEmail.Text = "";
                txtPassword.Text = "";
                cmbAccount.SelectedItem = null;
                listBoxCommands.Items.Clear();
                rtbLogCommand.Clear();
            }
        }