public void TestDeleteUser()
        {
            var user = AdministratorController.AddOrUpdateUser(0, "user", "name", "password", UserType.Administrator);

            AdministratorController.DeleteUser(user.Id);

            Assert.Throws <InvalidOperationException>(() => AdministratorController.GetUser(user.Id));
        }
Exemplo n.º 2
0
        private void RefreshTab2Fields()
        {
            if (lastUserId != -1)
            {
                //update
                var user = AdministratorController.GetUser(lastUserId);

                textBox9.Text  = user.Id.ToString();
                textBox10.Text = user.Username;
                textBox11.Text = user.Name;
                textBox12.Text = user.Password;
            }
            else
            {
                //new

                textBox9.Text  = "";
                textBox10.Text = "";
                textBox11.Text = "";
                textBox12.Text = "";
            }
        }