public void CleanUp() { _entity = null; _setUpSpecificationHandler = null; _standardProductRepository = null; _standardCategoryRepository = null; _standardSupplierRepository = null; }
public void SetUp() { _setUpSpecificationHandler = new StandardSetUpSpecificationHandler(); _standardProductRepository = new StandardRepository(_setUpSpecificationHandler, TestConnectionString); _standardSupplierRepository = new StandardRepository(_setUpSpecificationHandler, TestConnectionString); _standardCategoryRepository = new StandardRepository(_setUpSpecificationHandler, TestConnectionString); _entity = new Product { Id = TestValidOne, Name = TestValidName, Discontinued = TestValidDisconnection }; }
public StandardRepository(ISetUpSpecificationHandler specificationHandlerSetUp, string connectionString) { SpecificationHandler = specificationHandlerSetUp.SetUpChain(); _connectionString = string.IsNullOrWhiteSpace(connectionString) == false ? connectionString : throw new ArgumentException(); }
public IRepository CreateRepositoy(ISetUpSpecificationHandler setUpSpecificationHandler, string connectionString) { return(new StandardRepository(setUpSpecificationHandler, connectionString)); }
public void SetUp() { _setUpSpecificationHandler = new StandardSetUpSpecificationHandler(); _standardRepository = new StandardRepository(_setUpSpecificationHandler, TestConnectionString); _entity = null; }
public CategoriesController(IRepositoryFactory <Category> categoryRepositoryFactory, ISetUpSpecificationHandler specificationHandler) { _categoryRepository = (categoryRepositoryFactory ?? throw new ArgumentNullException()) .CreateRepository(specificationHandler ?? throw new ArgumentNullException(), string.IsNullOrWhiteSpace(ConnectionString) == false ? ConnectionString : throw new ArgumentException()); }
public SupplierService(IRepositoryFactory <Supplier> supplierRepositoryFactory, ISetUpSpecificationHandler specificationHandler) { _supplierRepository = (supplierRepositoryFactory ?? throw new ArgumentNullException()) .CreateRepository(specificationHandler ?? throw new ArgumentNullException(), string.IsNullOrWhiteSpace(ConnectionString) == false ? ConnectionString : throw new ArgumentException()); }