Exemplo n.º 1
0
        public void City_DEL_True()
        {
            //Arrange
            //Act
            var  deleteCity = _city.Delete(new SmartDB(), "6ca10b442a894258bd135cc9b0ddcb1e");
            bool flag       = deleteCity.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Exemplo n.º 2
0
        private void ButtonDelete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(TextBoxDescription.Text) &&
                _currentUser.Role == "Administrator")
            {
                var deleteCity = _city.Delete(new SmartDB(), _cityId);

                bool flag = deleteCity.Code == ErrorEnum.NoError;
                if (flag)
                {
                    MessageBox.Show("City Deleted");
                    ResetControls();
                    BindCityWithDataGrid();
                }
                else
                {
                    MessageBox.Show(deleteCity.Message);
                }
            }
            else
            {
                MessageBox.Show("No city to delete or Contact Admin.");
            }
        }