Exemple #1
0
        public void Meter_DEL_True()
        {
            //Arrange
            //Act
            var  deleteMeter = _meter.Delete(new SmartDB(), "e730b81865494ca78389dd7765286e08");
            bool flag        = deleteMeter.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Exemple #2
0
        private void ButtonDelete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(TextBoxSerialNumber.Text) &&
                _currentUser.Role == "Administrator")
            {
                var deleteMeter = _meter.Delete(new SmartDB(), _meterSerialNumber);

                bool flag = deleteMeter.Code == ErrorEnum.NoError;
                if (flag)
                {
                    MessageBox.Show("Meter Deleted");
                    ResetControls();
                    BindMeterWithDataGrid();
                }
                else
                {
                    MessageBox.Show(deleteMeter.Message);
                }
            }
            else
            {
                MessageBox.Show("No meter to delete or Contact Admin.");
            }
        }