public void TestInitialize()
        {
            var contextBuilder = new TestDbContextBuilder();

            contextBuilder.FillDb(CollectionsFactory.GetBooksCollection());
            contextBuilder.FillDb(CollectionsFactory.GetReviewsCollection());
            var context = contextBuilder.BuildContext();

            service = new ReviewService(context, new ReviewValidator(context));
        }
Exemple #2
0
        public void TestInitialize()
        {
            var contextBuilder = new TestDbContextBuilder();

            contextBuilder.FillDb(CollectionsFactory.GetBooksCollection());
            contextBuilder.FillDb(CollectionsFactory.GetLineItemsCollection());
            contextBuilder.FillDb(CollectionsFactory.GetOrdersCollection());
            this.dbContext = contextBuilder.BuildContext();
            this.service   = new LineItemService(this.dbContext);
        }
        public void TestInitialize()
        {
            var contextBuilder = new TestDbContextBuilder();

            contextBuilder.FillDb(CollectionsFactory.GetAuthorsCollection());
            contextBuilder.FillDb(CollectionsFactory.GetBooksCollection());
            contextBuilder.FillDb(CollectionsFactory.GetBookAuthorsCollection());

            service = new AuthorService(contextBuilder.BuildContext());
        }
        public void TestInitialize()
        {
            var contextBuilder = new TestDbContextBuilder();

            contextBuilder.FillDb(CollectionsFactory.GetAuthorsCollection());
            contextBuilder.FillDb(CollectionsFactory.GetBooksCollection());
            contextBuilder.FillDb(CollectionsFactory.GetBookAuthorsCollection());
            contextBuilder.FillDb(CollectionsFactory.GetReviewsCollection());
            var context = contextBuilder.BuildContext();

            service = new BookService(
                context,
                new BookValidator(),
                new BookAuthorValidator(context),
                new DiscountValidator(context)
                );
        }