public void MeterProtocol_SearchByDescription_True()
        {
            //Arrange
            //Act
            ReturnInfo getMeterProtocol = _meterProtocol.GetMeterProtocolByDescription(new SmartDB(), "Protocol C");
            bool       flag             = getMeterProtocol.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Example #2
0
        private void BindMeterProtocolWithDataGrid()
        {   //TODO: Refactor this for reuse.
            try
            {
                ReturnInfo getMeterProtocolList = _meterProtocol.GetMeterProtocolByDescription(new SmartDB(), TextBoxSearch.Text);

                List <TMF.Reports.Model.MeterProtocol> meterProtocol = (List <TMF.Reports.Model.MeterProtocol>)getMeterProtocolList.BizObject;
                var bindingList = new BindingList <TMF.Reports.Model.MeterProtocol>(meterProtocol);
                var source      = new BindingSource(bindingList, null);
                DataGridViewMeterProtocol.AutoGenerateColumns = false;
                DataGridViewMeterProtocol.DataSource          = source;
                LabelShow.Text = $"Showing {DataGridViewMeterProtocol.CurrentRow.Index + 1} index of {DataGridViewMeterProtocol.RowCount} records";
            }
            catch (Exception)
            {
                return;
            }
        }