Ejemplo n.º 1
0
        public void SetUp()
        {
            session.CreateQuery(@"delete SupplierPromotion").ExecuteUpdate();

            _supplier              = CreateSupplier();
            _catalog               = FindFirstFreeCatalog();
            _promotion             = CreatePromotion(_supplier, _catalog);
            _promotionWithFile     = CreatePromotion(_supplier, _catalog, withFile: true);
            _promotionNotModerated = CreatePromotion(_supplier, _catalog, false);
            Open();
            Click("Промо-акции");
            AssertText("Список акций");
        }
Ejemplo n.º 2
0
        private SupplierPromotion CreatePromotion(PromotionOwnerSupplier supplier, Catalog catalog, bool moderated)
        {
            var supplierPromotion = new SupplierPromotion {
                Enabled = true,
                PromotionOwnerSupplier = supplier,
                Annotation             = catalog.Name,
                Name      = catalog.Name,
                Begin     = DateTime.Now.Date.AddDays(-7),
                End       = DateTime.Now.Date,
                Moderated = moderated,
                Catalogs  = new List <Catalog> {
                    catalog
                }
            };

            supplierPromotion.UpdateStatus();
            session.Save(supplierPromotion);
            return(supplierPromotion);
        }
Ejemplo n.º 3
0
        private SupplierPromotion CreatePromotion(PromotionOwnerSupplier supplier, Catalog catalog, bool moderated = true, bool withFile = false)
        {
            var supplierPromotion = new SupplierPromotion {
                Enabled = true,
                PromotionOwnerSupplier = supplier,
                Annotation             = catalog.Name,
                Name      = catalog.Name,
                Begin     = DateTime.Now.Date.AddDays(-7),
                End       = DateTime.Now.Date.AddDays(1),
                Moderated = moderated,
                Catalogs  = new List <Catalog> {
                    catalog
                }
            };

            if (withFile)
            {
                supplierPromotion.PromoFile = "testName.jpg";
            }
            supplierPromotion.UpdateStatus();
            session.Save(supplierPromotion);
            return(supplierPromotion);
        }