protected void btnTest1_Click(object sender, EventArgs e) { lstbxUsers.Items.Clear(); userTest = new TestDeleteUser(); try { lblCreateUserPassFail.Visible = userTest.setUp(LoginSession.adminURL, LoginSession.userToken.token_id, "testTenant1138"); lblCreateUserPassFail.Text = "PASS"; disposable = userTest.getDisposable(); foreach (User u in userTest.users) { beforeList.Add(u); } foreach (User u in beforeList) { lstbxUsers.Items.Add(u.name); } Boolean ret = true; String output = String.Empty; //End Set Up while (disposable.Count > 0) { ret |= userTest.run(LoginSession.adminURL, LoginSession.userToken.token_id, disposable[0].id); disposable.RemoveAt(0); } lblRunTest1.Visible = ret; lblRunTest1.Text = "PASS"; //userTest.em.List_Endpoints(txtbAdminURL.Text, LoginSession.userToken.token_id, LoginSession.userToken.token_id); lstbxAfter.Items.Clear(); try { lblTearDown1.Visible = userTest.tearDown(LoginSession.adminURL, LoginSession.userToken.token_id); lblTearDown1.Text = "PASS"; foreach (User u in userTest.users) { afterList.Add(u); } foreach (User u in afterList) { lstbxAfter.Items.Add(u.name); } } catch (Exception x) { lblUser.Text = x.Message; lblCreateUserPassFail.Visible = true; lblCreateUserPassFail.Text = "FAIL"; } } //End Run Test catch (Exception x) { lblUser.Text = x.Message; lblCreateUserPassFail.Visible = true; lblCreateUserPassFail.Text = "FAIL"; pnlUserInfo.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (sender != null && sender.GetType().Equals(this.GetType())) { if (((UsersDelete)sender).CurrentTest != null) { userTest = ((UsersDelete)sender).CurrentTest; beforeList = ((UsersDelete)sender).beforeTestList; afterList = ((UsersDelete)sender).afterTestList; } else { userTest = new TestDeleteUser(); beforeList = new List<User>(); afterList = new List<User>(); } } else { userTest = new TestDeleteUser(); beforeList = new List<User>(); afterList = new List<User>(); } }