private void _view_OnUpdateData(object sender, EventArgs e) { using (new WaitCursorHandler()) { ListDataGrid listDataGrid = null; if (sender is ListDataGrid) { listDataGrid = (ListDataGrid)sender; } else { listDataGrid = _view.ListDataGrid; } if (listDataGrid != null && listDataGrid.SelectedItem != null) { var model = _services.GetById(((SatuanModel)listDataGrid.SelectedItem).id); if (model != null) { var view = new SatuanEntryView(false, model); view.OnSaveData += SatuanEntryView_OnSaveData; view.ShowDialog(); } } } }
public void ShouldReturnModelMatchingId() { SatuanModel model = null; var idToGet = 1; try { model = (SatuanModel)_services.GetById(idToGet); } catch (DataAccessException ex) { _testOutputHelper.WriteLine(ex.DataAccessStatusInfo.GetFormatedValues()); } Assert.True(model != null); Assert.True(model.id == idToGet); if (model != null) { TestsHelper.WriteModel(_testOutputHelper, model); } }