Example #1
0
 public OrdersFixture(ServiceProviderFixture serviceProviderFixture) : base(serviceProviderFixture)
 {
     this.OrdersToDelete  = new List <Order>();
     this.cartFixture     = new CartFixture(serviceProviderFixture);
     this.productFixture  = new ProductFixture(serviceProviderFixture);
     this.customerFixture = new CustomerFixture(serviceProviderFixture);
     this.channelFixture  = new ChannelFixture(serviceProviderFixture);
     this.statesFixture   = new StatesFixture(serviceProviderFixture);
     this.typeFixture     = new TypeFixture(serviceProviderFixture);
     this.paymentsFixture = new PaymentsFixture(serviceProviderFixture);
     this.projectFixture  = new ProjectFixture(serviceProviderFixture);
 }
 public CartFixture(ServiceProviderFixture serviceProviderFixture) : base(serviceProviderFixture)
 {
     this.CartToDelete           = new List <Cart>();
     this.customerFixture        = new CustomerFixture(serviceProviderFixture);
     this.productFixture         = new ProductFixture(serviceProviderFixture);
     this.shippingMethodsFixture = new ShippingMethodsFixture(serviceProviderFixture);
     this.taxCategoryFixture     = new TaxCategoryFixture(serviceProviderFixture);
     this.discountCodeFixture    = new DiscountCodeFixture(serviceProviderFixture);
     this.customerGroupFixture   = new CustomerGroupFixture(serviceProviderFixture);
     this.typeFixture            = new TypeFixture(serviceProviderFixture);
     this.shoppingListFixture    = new ShoppingListFixture(serviceProviderFixture);
     this.paymentsFixture        = new PaymentsFixture(serviceProviderFixture);
     this.projectFixture         = new ProjectFixture(serviceProviderFixture);
 }
Example #3
0
        public ProductProjectionSearchFixture(IMessageSink diagnosticMessageSink)
        {
            //create serviceProviderFixture Instance
            this.serviceProviderFixture = new ServiceProviderFixture(diagnosticMessageSink);

            this.productFixture          = new ProductFixture(this.serviceProviderFixture);
            this.projectFixture          = new ProjectFixture(this.serviceProviderFixture);
            this.categoryFixture         = new CategoryFixture(this.serviceProviderFixture);
            this.productTypeFixture      = new ProductTypeFixture(this.serviceProviderFixture);
            this.taxCategoryFixture      = new TaxCategoryFixture(this.serviceProviderFixture);
            this.stateFixture            = new StatesFixture(this.serviceProviderFixture);
            this.inventoryFixture        = new InventoryFixture(this.serviceProviderFixture);
            this.channelFixture          = new ChannelFixture(this.serviceProviderFixture);
            this.productDiscountsFixture = new ProductDiscountsFixture(this.serviceProviderFixture);
            this.reviewFixture           = new ReviewFixture(this.serviceProviderFixture);

            this.randomInt = TestingUtility.RandomInt();
            //Configure and Create all entities before running tests
            this.ConfigureAndCreateEntitiesBeforeRunningTests();
        }
        public void GetListAsyncTest()
        {
            using (var transaction = Fixture.Connection.BeginTransaction())
            {
                using (var context = Fixture.CreateContext(transaction))
                {
                    var projectListTask = context.Set <Project>()
                                          .Include(p => p.ProjectManager)
                                          .Include(p => p.Performers)
                                          .ThenInclude(e => e.Employer)
                                          .ToListAsync()
                    ;

                    var projectList = projectListTask.Result;

                    var expectedProjectsList = ProjectFixture.GetAllProjects();

                    AssertData(expectedProjectsList, projectList);
                }
            }
        }
        private void Seed()
        {
            lock (_lock)
            {
                if (!_databaseInitialized)
                {
                    using (var context = CreateContext())
                    {
                        context.Database.EnsureDeleted();
                        context.Database.EnsureCreated();

                        var firstProject  = ProjectFixture.GetFirstProject();
                        var secondProject = ProjectFixture.GetSecondProject();

                        context.Set <Project>().Add(firstProject);
                        context.Set <Project>().Add(secondProject);

                        context.SaveChanges();
                    }

                    _databaseInitialized = true;
                }
            }
        }