public void SetUp()
 {
     mealFactory = new BreakfastRuleFactory();
     map = MealMapFactory.Create(Constants.Morning);
     output = new List<string>();
     dishes = new List<int>();
 }
 public void TearDown()
 {
     mealFactory = null;
     output = null;
     dishes = null;
     rule = null;
 }
 public void SetUp()
 {
     mealFactory = new DinnerRuleFactory();
     map = MealMapFactory.Create("night");
     output = new List<string>();
     dishes = new List<int>();
 }
Example #4
0
 public FoodController(IFoodFactory foodFactory, IMealFactory mealFactory, IFoodRepository repository, IMealRepository mealRepository)
 {
     this.repository = repository;
     this.mealRepository = mealRepository;
     this.foodFactory = foodFactory;
     this.mealFactory = mealFactory;
 }
Example #5
0
    public MealFactory(MealRequirements requirements)
    {
        if (!requirements.IsHuman)
        {
            _factory = (IMealFactory) new Ogre();
        }
        else
        {
            switch (requirements.mealTime)
            {
            case 0:
                _factory = (IMealFactory) new Breakfast();
                break;

            case 1:
                _factory = (IMealFactory) new Lunch();
                break;

            case 2:
                _factory = (IMealFactory) new DinDin();
                break;

            default:
                _factory = (IMealFactory) new Breakfast();
                break;
            }
        }
        _requirements = requirements;
    }
Example #6
0
 public MealTest()
 {
     _mealFactory = new MealFactory();
 }
Example #7
0
 public MealController(IMealFactory factory, IMealRepository repository)
 {
     this.mealFactory = factory;
     this.repository = repository;
 }