Example #1
0
        public void City_SearchByDescription_True()
        {
            //Arrange
            //Act
            ReturnInfo getCity = _city.GetCityByDescription(new SmartDB(), "Al Damman");
            bool       flag    = getCity.Code == ErrorEnum.NoError;

            //Assert
            Assert.IsTrue(flag);
        }
Example #2
0
        private void BindCityWithDataGrid()
        {   //TODO: Refactor this for reuse.
            try
            {
                ReturnInfo getCityList = _city.GetCityByDescription(new SmartDB(), TextBoxSearch.Text);

                List <City> city        = (List <City>)getCityList.BizObject;
                var         bindingList = new BindingList <City>(city);
                var         source      = new BindingSource(bindingList, null);
                DataGridViewCity.AutoGenerateColumns = false;
                DataGridViewCity.DataSource          = source;
                _rowCount      = DataGridViewCity.RowCount;
                LabelShow.Text = $"Showing {DataGridViewCity.CurrentRow.Index + 1} index of {_rowCount} records";
            }
            catch (Exception)
            {
                return;
            }
        }