Пример #1
0
        private void FormOrderProduct_Load(object sender, EventArgs e)
        {
            ProductView[] array = driver.GetAllProducts().ToArray();
            comboBox.Items.AddRange(array);

            ProductView selected = driver.GetSelectedProduct();

            if (selected != null)
            {
                foreach (ProductView product in array)
                {
                    if (product.Name == selected.Name)
                    {
                        comboBox.SelectedItem = product;
                        break;
                    }
                }
            }

            textBox.Text = driver.GetCount().ToString();
        }
Пример #2
0
        public void TestGetCount()
        {
            ProductLogic logic = new ProductLogic();

            try
            {
                logic.Create(new ProductBinding {
                    Name = "Test1", Price = 10
                });
                OrderProductView orderProduct = new OrderProductView {
                    ProductId = 1, Count = 10
                };

                OrderProductPageDriver driver = new OrderProductPageDriver(new UiContext(new OrderLogic(), logic), new OrderView(), orderProduct);
                int count = driver.GetCount();

                Assert.Equal(10, count);
            }
            finally
            {
                logic.Delete(null);
            }
        }