private void priceTab_Enter(object sender, EventArgs e) { promoComboBox.Items.Clear(); productComboBox.Items.Clear(); promoComboBox.Items.AddRange(PromoPresenter.GetPromotions().ToArray()); productComboBox.Items.AddRange(ProductPresenter.GetProducts().ToArray()); }
public void Should_Get_Products_From_Repo() { var sut = new ProductPresenter(this.mockProductView.Object, this.mockProductRepo.Object, this.mockOpenFileDialog.Object); var prodList = new List <Product> { new Product { Id = 1, Name = "ABC", UnitPrice = 100 }, new Product { Id = 2, Name = "XYZ", UnitPrice = 200 } }; this.mockProductRepo.Setup(x => x.GetByFileName(It.IsAny <string>())).Returns(prodList); sut.GetProducts(); this.mockProductRepo.Verify(p => p.GetByFileName(It.IsAny <string>()), Times.Once); }
private void UpdateDataGridView() { dataGridView.DataSource = ProductPresenter.GetProducts(); }