Ejemplo n.º 1
0
        public PersistentCoreBusinessDataSet()
        {
            this.ArticlesIds   = new List <int>();
            this.CategoriesIds = new List <int>();

            this.connection = new SqlConnection(DatabaseConfiguration.CoreBusinessConnectionString);
            this.connection.Open();

            this.categories = new CategoriesSqlHelper(this.connection);
            this.articles   = new ArticlesSqlHelper(this.connection);
        }
Ejemplo n.º 2
0
        public DBaseSalesServiceTest()
        {
            this.dataSet = new PersistentCoreBusinessDataSet();

            this.connection        = new SqlConnection(DatabaseConfiguration.CoreBusinessConnectionString);
            this.articlesSqlHelper = new ArticlesSqlHelper(this.connection);

            this.article = new Article
            {
                IdCategory  = 1,
                Title       = "Title",
                Description = "Description",
                ImagesPath  = Guid.NewGuid(),
                Price       = 100m
            };

            container.Options.DefaultScopedLifestyle = new ThreadScopedLifestyle();
            container.Register <ICoreBusinessContext, CoreBusinessTestContext>(Lifestyle.Scoped);
            container.Register <IArticlesRepository, ArticlesRepository>(Lifestyle.Scoped);
            container.Register <ICategoriesRepository, CategoriesRepository>(Lifestyle.Scoped);
            container.Register <SalesService>(Lifestyle.Scoped);
            container.Verify();
        }