public void ListData_CallDalListData() { // arrange // act var actual = _colorBL.ListData(); // assert _colorDal.Verify(x => x.ListData(), Times.Once); }
private void LoadColorComboBox() { ColorIDComboBox.DataSource = null; ColorIDComboBox.Items.Clear(); // ambil data var listColor = _colorBL.ListData(); // exit jika kosong if (listColor == null) { return; } var listColorOrdered = listColor .OrderBy(x => x.ColorID) .Select(x => x.ColorID) .ToList(); ColorIDComboBox.DataSource = listColorOrdered; }
void LoadColorCombo() { ColorComboBox.DataSource = null; ColorComboBox.Items.Clear(); // ambil data var listColor = _colorBL.ListData(); // exit jika kosong if (listColor == null) { return; } var listColorWithHue = from c in listColor select new { c.ColorID, c.RedValue, c.GreenValue, c.BlueValue, Hue = Color.FromName(c.ColorID).GetHue() }; listColorWithHue = listColorWithHue .OrderBy(x => x.RedValue) .ThenBy(x => x.GreenValue) .ThenBy(x => x.BlueValue) .ToList(); ColorComboBox.DataSource = listColorWithHue; ColorComboBox.DisplayMember = "ColorID"; ColorComboBox.ValueMember = "ColorID"; var color = _colorBL.GetData(ColorComboBox.SelectedValue.ToString()); ColorPanel.BackColor = _colorBL.GetFromRGB(color); ColorComboBox.SelectedItem = null; }