protected override void Before_all_specs()
        {
            SetupDatabase(ShopGunSpecBase.Database.ShopGun, typeof(Base).Assembly);

            IConfiguration configuration = new BasicConfiguration();
            var container = configuration.Container;

            _ingredientRepository = new IngredientRepository(GetNewDataContext());
            _semaphoreRepository = new Repository<Semaphore>(GetNewDataContext());
            _mentorRepository = new Repository<Mentor>(GetNewDataContext());

            _ingredientAdviceRepository = new Repository<IngredientAdvice>(GetNewDataContext());
            _ingredientAdviceDomainService = new IngredientAdviceDomainService(_ingredientRepository,
                                                                               _ingredientAdviceRepository,
                                                                               GetNewDataContext());

           

            _mentor = MentorBuilder.BuildMentor();
            _mentorRepository.Add(_mentor);
            _mentorRepository.Persist();

            _redSemaphore = SemaphoreBuilder.BuildRedSemaphore();
            _semaphoreRepository.Add(_redSemaphore);
            _greenSemaphore = SemaphoreBuilder.BuildGreenSemaphore();
            _semaphoreRepository.Add(_greenSemaphore);
            _semaphoreRepository.Persist();

            _ingredient = IngredientBuilder.BuildIngredient();
            _ingredientRepository.Add(_ingredient);
            _ingredientRepository.Persist();

            base.Before_each_spec();
        }
Пример #2
0
 public ProductAdvice BuildProductAdvice(Mentor mentor, Semaphore semaphore)
 {
     var productAdvice = new ProductAdvice()
                            {
                                Advice = "Sveriges Konsumenter anmälde Coca Cola för vilseledande GDA-märkning av sina Coca Cola-flaskor. Att en flaska om 500 ml skulle utgöra två portioner framstår som vilseledande, likaså det faktum att företaget använder två olika portionsstorlekar när det beräknar GDA.",
                                Introduction = "Coca Cola anmält för vilseledande GDA-märkning av dryckesflaskor.",
                                KeyWords = "Coca-Cola, Mer",
                                Label = "Svenska nyheter",
                                Mentor = mentor,
                                Semaphore = semaphore,
                                Published = true,
                                PublishDate = DateTime.Now
                            };
     return productAdvice;
 }
        protected override void Before_all_specs()
        {
            SetupDatabase(ShopGunSpecBase.Database.ShopGun, typeof (Base).Assembly);

            RepositoryFactory = CreateStub<RepositoryFactory<IAdviceRepository, AdviceBase>>();

            _adviceApplicationService = new AdviceApplicationService(null, null);

            var mentorRepository = RepositoryFactory.Build<IRepository<Mentor>, Mentor>();

            _mentor = new Mentor
                          {
                              MentorName = "Consumentor"
                          };
            mentorRepository.Add(_mentor);
            mentorRepository.Persist();


            var semaphoreRepository = RepositoryFactory.Build<IRepository<Semaphore>, Semaphore>();

            _redSemaphore = new Semaphore
                                {
                                    ColorName = "Red",
                                    Value = -1
                                };
            semaphoreRepository.Add(_redSemaphore);
            _greenSemaphore = new Semaphore
                                  {
                                      ColorName = "Green",
                                      Value = 1
                                  };
            semaphoreRepository.Add(_greenSemaphore);
            semaphoreRepository.Persist();


            var productRepository = RepositoryFactory.Build<IRepository<Product>, Product>();

            _product = ProductBuilder.BuildProduct();
            productRepository.Add(_product);
            productRepository.Persist();

        }
        protected override void Before_all_specs()
        {
            SetupDatabase(ShopGunSpecBase.Database.ShopGun, typeof(Base).Assembly);
            _productBuilder = new ProductBuilder();

            _productAdviceRepository = new Repository<ProductAdvice>(GetNewDataContext());
            _productAdviceDomainService =
                new ProductAdviceDomainService(new ProductRepository(GetNewDataContext()),
                                                   _productAdviceRepository, GetNewDataContext());

            _productRepository = new ProductRepository(GetNewDataContext());
            _semaphoreRepository = new Repository<Semaphore>(GetNewDataContext());
            _mentorRepository = new Repository<Mentor>(GetNewDataContext());     

            _mentor = new Mentor
                          {
                MentorName = "Consumentor"
            };
            _mentorRepository.Add(_mentor);
            _mentorRepository.Persist();

            _redSemaphore = new Semaphore
                             {
                ColorName = "Red",
                Value = -1
            };
            _semaphoreRepository.Add(_redSemaphore);
            _greenSemaphore = new Semaphore
                                  {
                                      ColorName = "Green",
                                      Value = 1
                                  };
            _semaphoreRepository.Add(_greenSemaphore);
            _semaphoreRepository.Persist();

            _product = ProductBuilder.BuildProduct();
            _productRepository.Add(_product);
            _productRepository.Persist();

            base.Before_each_spec();
        }
Пример #5
0
        protected override void Before_all_specs()
        {
            SetupDatabase(ShopGunSpecBase.Database.ShopGun, typeof(Base).Assembly);

            _ingredientAdviceRepository = new Repository<IngredientAdvice>(GetNewDataContext());

            _ingredientRepository = new IngredientRepository(GetNewDataContext());
            _semaphoreRepository = new Repository<Semaphore>(GetNewDataContext());
            _mentorRepository = new Repository<Mentor>(GetNewDataContext());

            _mentor = MentorBuilder.BuildMentor();
            _mentorRepository.Add(_mentor);
            _mentorRepository.Persist();

            _redSemaphore = SemaphoreBuilder.BuildRedSemaphore();
            _semaphoreRepository.Add(_redSemaphore);
            _greenSemaphore = SemaphoreBuilder.BuildGreenSemaphore();
            _semaphoreRepository.Add(_greenSemaphore);
            _semaphoreRepository.Persist();

            base.Before_each_spec();
        }