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();
        }
Exemplo n.º 2
0
 protected override void Before_each_spec()
 {
     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());
 }
Exemplo n.º 3
0
 public ResultController(ICocktailRepository cocktailRepo,
     ICocktailIngredientRepository ciRepo,
     IIngredientRepository ingredientRepo)
 {
     _cocktailRepo = cocktailRepo;
     _ingredientRepo = ingredientRepo;
     _ciRepo = ciRepo;
 }
Exemplo n.º 4
0
 public HomeController(IIngredientRepository ingredientRepository, IRecipeRepository recipeRepository, IDietRepository dietRepository, IAuthorRepository authorRepository, ICommentRepository commentRepository)
 {
     _ingredientRepository = ingredientRepository;
     _recipeRepository = recipeRepository;
     _dietRepository = dietRepository;
     _authorRepository = authorRepository;
     _commentRepository = commentRepository;
 }
Exemplo n.º 5
0
 public RecipesController(IRecipeRepository recipeRepo, IRecipeIngredientRepository recipeIngredientRepo, IInstructionRepository instructionRepo, IIngredientRepository ingredientRepo, IEquipmentRepository equipmentRepo, IRecipeEquipmentRepository recipeEquipmentRepo, IUserRepository userRepo)
 {
     RecipeRepo = recipeRepo;
     RecipeIngredientRepo = recipeIngredientRepo;
     InstructionRepo = instructionRepo;
     IngredientRepo = ingredientRepo;
     EquipmentRepo = equipmentRepo;
     RecipeEquipmentRepo = recipeEquipmentRepo;
     UserRepo = userRepo;
 }
Exemplo n.º 6
0
 public AdminController(ICocktailRepository cocktailRepo,
     ICocktailIngredientRepository ciRepo,
     IIngredientRepository ingredientRepo,
     IRecipeRespository recipeRepo)
 {
     _cocktailRepo = cocktailRepo;
     _ingredientRepo = ingredientRepo;
     _ciRepo = ciRepo;
     _recipeRepo = recipeRepo;
 }
Exemplo n.º 7
0
 public static IIngredientRepository GetIngredientRepository()
 {
     if (_ingredientRepo == null)
     {
         if (GetMode() != "Mock")
         {
             _ingredientRepo = new IngredientSqlRepository();
         }
         //otherwise get a different repo
     }
     return _ingredientRepo;
 }
Exemplo n.º 8
0
 public MealController(IMealRepository mealRepository, IIngredientRepository ingredientRepository, IQuantityTypeRepository quantityTypeRepository, IIngredientCategoryRepository ingredientCategoryRepository, IMealIngredientRepository mealIngredientRepository, IMealCategoryRepository categoryRepository, IRecipeRepository recipeRepository, IUserRepository userRepository, IAuthorRepository authorRepository, IIngredientQuantityRepository ingredientQuantityRepository)
 {
     _mealRepository = mealRepository;
     _ingredientRepository = ingredientRepository;
     _quantityTypeRepository = quantityTypeRepository;
     _ingredientCategoryRepository = ingredientCategoryRepository;
     _mealIngredientRepository = mealIngredientRepository;
     _categoryRepository = categoryRepository;
     _recipeRepository = recipeRepository;
     _userRepository = userRepository;
     _authorRepository = authorRepository;
     _ingredientQuantityRepository = ingredientQuantityRepository;
 }
Exemplo n.º 9
0
 public StoreCupboardController(
     IStoreCupboardIngredientRepository storeCupboardIngredientRepo,
     IStoreCupboardEquipmentRepository storeCupboardEquipmentRepo,
     IUserRepository userRepository,
     IIngredientRepository ingredientRepository,
     IEquipmentRepository equipmentRepository
     )
 {
     StoreCupboardIngredientRepo = storeCupboardIngredientRepo;
     StoreCupboardEquipmentRepo = storeCupboardEquipmentRepo;
     UserRepository = userRepository;
     IngredientRepository = ingredientRepository;
     EquipmentRepository = equipmentRepository;
 }
Exemplo n.º 10
0
 public MealCalculatorTest()
 {
     MapperConfig.ConfigureMapper();
     _dietRepository = new FakeDietRepository();
     _commentRepository = new FakeCommentRepository();
     _userRepository = new FakeUserRepository();
     _dietCategoryRepository = new FakeDietCategoryRepository();
     _dietMealRepository = new FakeDietMealRepository();
     _dietIngredientRepository = new FakeDietIngredientRepository();
     _quantityTypeRepository = new FakeQuantityTypeRepository();
     _userDietRepository = new FakeUserDietRepository();
     _ingredientRepository = new FakeIngredientRepository();
     _mealRepository = new FakeMealRepository();
     _ingredientQuantityRepository = new FakeIngredientQuantityRepository();
 }
Exemplo n.º 11
0
 public MealControllerTest()
 {
     MapperConfig.ConfigureMapper();
     _mealRepository = new FakeMealRepository();
     _ingredientRepository = new FakeIngredientRepository();
     _quantityTypeRepository = new FakeQuantityTypeRepository();
     _ingredientCategoryRepository = new FakeIngredientCategoryRepository();
     _mealIngredientRepository = new FakeMealIngredientRepository();
     _mealCategoryRepository = new FakeMealCategoryRepository();
     _recipeRespository = new FakeRecipeRepository();
     _userRepository =  new FakeUserRepository();
     _authorRepository = new FakeAuthorRepository();
     _ingredientQuantityRepository = new FakeIngredientQuantityRepository();
     _controller = new MealController(_mealRepository, _ingredientRepository, _quantityTypeRepository, _ingredientCategoryRepository, _mealIngredientRepository, _mealCategoryRepository, _recipeRespository, _userRepository, _authorRepository, _ingredientQuantityRepository);
 }
        protected override void Before_each_spec()
        {
            _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());

            using (var dataContext = GetNewDataContext())
            {
                var advices = dataContext.GetTable<AdviceBase>().Where(x => x.Id != 0);
                dataContext.GetTable<AdviceBase>().DeleteAllOnSubmit(advices);
                dataContext.SubmitChanges();
            }
        }
Exemplo n.º 13
0
 public DietControllerTest()
 {
     MapperConfig.ConfigureMapper();
     _dietRepository = new FakeDietRepository();
     _commentRepository = new FakeCommentRepository();
     _userRepository = new FakeUserRepository();
     _dietCategoryRepository = new FakeDietCategoryRepository();
     _dietMealRepository = new FakeDietMealRepository();
     _dietIngredientRepository = new FakeDietIngredientRepository();
     _quantityTypeRepository = new FakeQuantityTypeRepository();
     _userDietRepository = new FakeUserDietRepository();
     _ingredientRepository = new FakeIngredientRepository();
     _mealRepository = new FakeMealRepository();
     _ingredientQuantityRepository = new FakeIngredientQuantityRepository();
     _mealIngredientRepository = new FakeMealIngredientRepository();
     _tracer = new Tracer();
     _controller = new DietController(_dietRepository, _commentRepository, _userRepository, _dietCategoryRepository, _dietMealRepository, _dietIngredientRepository, _quantityTypeRepository, _userDietRepository, _ingredientQuantityRepository, _tracer);
 }
Exemplo n.º 14
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();
        }
 public IngredientApplicationService(RepositoryFactory repositoryFactory)
 {
     _repositoryFactory = repositoryFactory;
     _ingredientRepository = _repositoryFactory.Build<IIngredientRepository, Ingredient>();
 }
 public UserIngredientBusinessLogic(IUserIngredientRepository userIngredientRepository, IIngredientRepository ingredientRepository, INutrientRepository nutrientRepository)
 {
     this.userIngredientRepository = userIngredientRepository;
     this.ingredientRepository = ingredientRepository;
     this.nutrientRepository = nutrientRepository;
 }
Exemplo n.º 17
0
 public HomeController(IIngredientRepository ingredientRepo)
 {
     _ingredientRepo = ingredientRepo;
 }
 public GetIngredientByIdQueryHandler(IIngredientRepository repository)
 {
     this.repository = repository;
 }
 public DrugRepository(ICSVStream <Drug> stream, ISequencer <long> sequencer, IIngredientRepository ingredientRepository)
     : base(stream, sequencer)
 {
     _ingredientRepository = ingredientRepository;
 }
Exemplo n.º 20
0
 public IngredientsController(IIngredientRepository ingredientRepository, IRecipeRepository recipeRepository)
 {
     _ingredientRepository = ingredientRepository;
     _recipeRepository     = recipeRepository;
 }
 public void Initialize()
 {
     this.client = new FileClientMock();
     this.ingredientRepository = new IngredientRepository(this.client);
 }
 public GetIngredientQueryHandler(IIngredientRepository ingredientRepository) =>
Exemplo n.º 23
0
 public OrderService(IIngredientRepository ingredientRepository, IDishRepository dishRepository)
 {
     _ingredientRepository = ingredientRepository;
     _dishRepository       = dishRepository;
 }
Exemplo n.º 24
0
        public MainDialog(OrderPizzaRecognizer recognizer, UserState userState, IPizzaRepository pizzaRepository, IIngredientRepository ingredientRepository)
            : base(nameof(MainDialog), recognizer)
        {
            _recognizer           = recognizer;
            _userState            = userState;
            _pizzaRepository      = pizzaRepository;
            _ingredientRepository = ingredientRepository;
            _orderInfo            = _userState.CreateProperty <OrderInfo>("OrderInfo");

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new OrderPizzaDialog(userState, _recognizer, _pizzaRepository, _ingredientRepository));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                ActAsync
            }));
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemplo n.º 25
0
 public IngredientBusinessLogic(IIngredientRepository ingredientRepository)
 {
     this.ingredientRepository = ingredientRepository;
 }
Exemplo n.º 26
0
 public RecipeService(IIngredientRepository ingredientRepository, IRecipeRepository recipeRepository)
 {
     _recipeRepository     = recipeRepository;
     _ingredientRepository = ingredientRepository;
 }
 public CommandsFactory(IIngredientRepository ingredientRepository)
 {
     _fakeRecipeIngredientsFactory = new FakeRecipeIngredientsFactory(ingredientRepository);
 }
Exemplo n.º 28
0
        public CustomPizzaDialog(UserState userState, OrderPizzaRecognizer recognizer, IPizzaRepository pizzaRepository, IIngredientRepository ingredientRepository)
            : base(nameof(CustomPizzaDialog), userState, recognizer)
        {
            _userState            = userState;
            _pizzaRepository      = pizzaRepository;
            _ingredientRepository = ingredientRepository;
            _orderInfo            = _userState.CreateProperty <OrderInfo>("OrderInfo");

            AddDialog(new TextPrompt("GetIngredients"));
            AddDialog(new ChoicePrompt("ChoicePizzaSize", ValidateMaxAttemptsReached, "es"));
            AddDialog(new ConfirmPrompt("ConfirmIngredients", ValidateConfirmation, "es"));
            AddDialog(new ChoicePrompt("ChoicePizzaDough", ValidateMaxAttemptsReached, "es"));
            AddDialog(new ConfirmPrompt("ConfirmPizzaConfiguration", ValidateConfirmation, "es"));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskForIngredientsAsync,
                AskForIngredientConfirmationAsync,
                AcceptIngredientsAsync,
            }));
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemplo n.º 29
0
 public MealRepository(IReadWriteHelper rwHelper, IIngredientRepository ingredientRepository)
 {
     this._rwHelper             = rwHelper;
     this._ingredientRepository = ingredientRepository;
 }
Exemplo n.º 30
0
 public UpdateIngredientCommandHandler(IIngredientRepository repository)
 {
     this.repository = repository;
 }
Exemplo n.º 31
0
 public IngredientsController(IIngredientRepository ingredientRepo)
 {
     IngredientRepo = ingredientRepo;
 }
Exemplo n.º 32
0
 public Ingredients(IIngredientRepository repo)
 {
     _repo = repo;
 }
Exemplo n.º 33
0
 public IngredientImporter(IIngredientParser ingredientParser, IIngredientFileReader ingredientFileReader, IIngredientRepository ingredientRepository)
 {
     this.ingredientParser = ingredientParser;
     this.ingredientFileReader = ingredientFileReader;
     this.ingredientRepository = ingredientRepository;
 }
Exemplo n.º 34
0
 public FilterController()
 {
     this.ingredientRepository = DependencyResolver.Current.GetService <IIngredientRepository>();
 }