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
            };
        }
Ejemplo n.º 3
0
 public StandardRepository(ISetUpSpecificationHandler specificationHandlerSetUp, string connectionString)
 {
     SpecificationHandler = specificationHandlerSetUp.SetUpChain();
     _connectionString    = string.IsNullOrWhiteSpace(connectionString) == false ? connectionString : throw new ArgumentException();
 }
Ejemplo n.º 4
0
 public IRepository CreateRepositoy(ISetUpSpecificationHandler setUpSpecificationHandler, string connectionString)
 {
     return(new StandardRepository(setUpSpecificationHandler, connectionString));
 }
Ejemplo n.º 5
0
 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());
 }
Ejemplo n.º 7
0
 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());
 }