public void Constructor_AllEnabled_EnabledShouldBeContainedAllStores()
        {
            StoreRespository storeRespository = CreateStoreRespository();

            storeRespository.EnableAllStores();
            Assert.AreEqual((object)3, (object)storeRespository.EnabledStores.Count);
        }
Exemple #2
0
 protected BaseController()
 {
     NewsService                = new NewsRepository();
     NewsGroupService           = new NewsGroupRepository();
     AccountService             = new AccountRepository();
     ContactService             = new ContactRepository();
     ProductTypeService         = new Respository.ProductTypeRepository();
     SiteConfigService          = new SiteConfigRespository();
     EmailConfigService         = new EmailConfigRepository();
     MenuConfigService          = new MenuConfigRespository();
     ProductBrandService        = new ProductBrandRespository();
     ProductManufacturerService = new ProductManufacturerRespository();
     ProductDistributorService  = new ProductDistributorRespository();
     ProductStoreService        = new StoreRespository();
     UnitService                = new UnitRespository();
     ColorService               = new ColorRespository();
     CountryService             = new CountryRespository();
     SizeService                = new SizeRespository();
     ProductAttributeService    = new ProductAttributeRespository();
     ProductImageService        = new ProductImageRespository();
     UserService                = new UserRespository();
     RoleService                = new RoleRespository();
     PermissionService          = new PermissionRespository();
     ProductSizeService         = new ProductSizeRespository();
     ProductColorService        = new ProductColorRespository();
     ProductSaleOffService      = new ProductSaleOffRespository();
     ProductService             = new ProductRespository();
     AdminAccountService        = new AdminRespository();
     BannerService              = new BannerRespository();
 }
        public void EnabledStore_WithValidStore_StoreShouldBeEnabled()
        {
            StoreRespository storeRespository = CreateStoreRespository();

            storeRespository.EnableStore(_testStore1.Name);
            Assert.IsTrue(storeRespository.IsStoreEnabled(_testStore1.Name));
        }
        public void AllEnabled_WithThreeStores_EnabledShouldBeThree()
        {
            StoreRespository storeRespository = CreateStoreRespository();

            storeRespository.EnableAllStores();
            Assert.AreEqual((object)3, (object)storeRespository.EnabledStores.Count);
        }
        public void DisableStore_ForAlreadyEnabledStore_ShouldLeaveStoreDisabled()
        {
            StoreRespository storeRespository = CreateStoreRespository();

            storeRespository.EnableStore(_testStore1.Name);
            storeRespository.DisableStore(_testStore1.Name);
            Assert.IsFalse(storeRespository.IsStoreEnabled(_testStore1.Name));
        }
        public void EnableStore_ForAlreadyEnabledStore_ShouldLeaveStoreEnabled()
        {
            StoreRespository storeRespository = CreateStoreRespository();

            storeRespository.EnableAllStores();
            storeRespository.EnableStore(_testStore1.Name);
            Assert.IsTrue(storeRespository.IsStoreEnabled(_testStore1.Name));
        }
        public void Constructor_AllEnabled_EachStoreShouldBeEnabled()
        {
            StoreRespository storeRespository = CreateStoreRespository();

            storeRespository.EnableAllStores();
            Assert.IsTrue(storeRespository.IsStoreEnabled(_testStore1.Name));
            Assert.IsTrue(storeRespository.IsStoreEnabled(_testStore2.Name));
            Assert.IsTrue(storeRespository.IsStoreEnabled(_testStore3.Name));
        }
        public StoreIO(IStoreInputter inputter, IStoreOutputter outputter)
        {
            this._inputter  = inputter;
            this._outputter = outputter;
            string connectionString = _inputter.readConnectionString();

            _storeRespository = new StoreRespository(StoreRespository.createStoreOptions(connectionString));
            this._customers   = _storeRespository.readAllCustomers();
            this._orders      = _storeRespository.getAllOrders();
            _inventory        = _storeRespository.getAllInventory();
        }