Ejemplo n.º 1
0
 public override int GetHashCode() => BreadType.GetHashCode() ^
 CheeseType.GetHashCode() ^
 HasMayo.GetHashCode() ^
 HasMustard.GetHashCode() ^
 IsToasted.GetHashCode() ^
 MeatType.GetHashCode() ^
 Vegetables.GetHashCode();
 public CheesePhrase(
     IFoodProduct currentFood,
     CheeseType Cheese)
 {
     this.currentFood = currentFood;
     this.Cheese      = Cheese;
 }
Ejemplo n.º 3
0
        private IAdditive CheeseFactory(CheeseType sauce, int quantity)
        {
            switch (sauce)
            {
            case CheeseType.BlueCheese:
                return(new BlueCheese(quantity));

            case CheeseType.Cheddar:
                return(new Cheddar(quantity));

            case CheeseType.Emmental:
                return(new Emmental(quantity));

            case CheeseType.Feta:
                return(new Feta(quantity));

            case CheeseType.Gouda:
                return(new Gouda(quantity));

            case CheeseType.Mozzarella:
                return(new Mozzarella(quantity));

            case CheeseType.SmokedCheese:
                return(new SmokedCheese(quantity));

            default:
                throw new NullReferenceException("No such cheese");
            }
        }
Ejemplo n.º 4
0
 public Pizza(DoughType doughType, bool isRedPepper, Size size, CheeseType cheeseType, List <string> vegetables)
 {
     this.doughType   = doughType;
     this.isRedPepper = isRedPepper;
     this.size        = size;
     this.cheeseType  = cheeseType;
     this.vegetables  = vegetables;
 }
Ejemplo n.º 5
0
 public void PrepareRecipe(BreadType breadType, CheeseType cheeseType)
 {
     _sandwichRecipe.ChooseBread(breadType);
     _sandwichRecipe.AddProtein();
     _sandwichRecipe.AddCheese(cheeseType);
     _sandwichRecipe.AddVegetables();
     _sandwichRecipe.AddSauces();
 }
Ejemplo n.º 6
0
 public Sandwich(BreadType bread, CheeseType cheese, bool hasMayo, bool istoasted, bool HasMustard, List <string> vegetables)
 {
     this.Bread      = bread;
     this.Cheese     = cheese;
     this.HasMayo    = hasMayo;
     this.IsToasted  = IsToasted;
     this.HasMustard = HasMustard;
     this.Vegetables = vegetables;
 }
        public void GetMyOwnCalories_WeightAndTypeSpecified_EmitsWeightAndTypeRelatedCalories(
            int weight,
            CheeseType typeOfCheese,
            int expectedCalories)
        {
            var instanceUnderTest = this.GetInstanceUnderTest(weight, typeOfCheese);

            instanceUnderTest.GetMyOwnCalories().Should().Be(expectedCalories);
        }
        private Ingredients.Cheese.Cheese GetInstanceUnderTest(int weight, CheeseType typeOfCheese)
        {
            var foodIngrediantMock = new Mock <IFoodProduct>();

            return(new Ingredients.Cheese.Cheese(
                       foodIngrediantMock.Object,
                       weight,
                       typeOfCheese));
        }
Ejemplo n.º 9
0
 public Cheese(string name, string description, CheeseType type, int rating)
 {
     Name        = name;
     Description = description;
     Type        = type;
     Rating      = rating;
     CheeseId    = nextId;
     nextId++;
 }
Ejemplo n.º 10
0
 public Sandwich(BreadType bread, CheeseType cheese, bool hasMayo, bool istoasted, bool HasMustard, List<string> vegetables)
 {
     this.Bread = bread;
     this.Cheese = cheese;
     this.HasMayo = hasMayo;
     this.IsToasted = IsToasted;
     this.HasMustard = HasMustard;
     this.Vegetables = vegetables;
 }
Ejemplo n.º 11
0
 public Cheese(
     IFoodProduct decoratedInstance,
     int weight,
     CheeseType cheeseType) :
     base(decoratedInstance, weight)
 {
     this.cheeseType = cheeseType;
     this.weight     = weight;
 }
Ejemplo n.º 12
0
 public Sandwich(BreadType breadType, bool isToasted, CheeseType cheeseType, MeatType meatType, bool hasMustard, bool hasMayo, List <string> vegetables)
 {
     BreadType  = breadType;
     IsToasted  = isToasted;
     CheeseType = cheeseType;
     MeatType   = meatType;
     HasMustard = hasMustard;
     HasMayo    = hasMayo;
     Vegetables = vegetables;
 }
Ejemplo n.º 13
0
 public Sandwich(BreadType breadType, bool isToasted, CheeseType cheeseType, MeatType meatType, bool hasMustard,
                 bool hasMayo, List <string> vegetables)
 {
     _breadType  = breadType;
     _isToasted  = isToasted;
     _cheeseType = cheeseType;
     _meatType   = meatType;
     _hasMustard = hasMustard;
     _hasMayo    = hasMayo;
     _vegetables = vegetables;
 }
Ejemplo n.º 14
0
 public Entree(int calories, int fats, int proteins, int carbohydrates, string toppings, PattyType patty, string bun, CheeseType cheese, string title, int price, string desc) : base(title, price, desc)
 {
     Bun           = bun;
     CheeseType    = cheese;
     PattyType     = patty;
     Toppings      = toppings;
     Calories      = calories;
     Fats          = fats;
     Proteins      = proteins;
     Carbohydrates = carbohydrates;
 }
Ejemplo n.º 15
0
 public Sandwich_Original(BreadType breadType, bool isToasted, CheeseType cheeseType,
                          MeatType meatType, bool hasMustard, bool hasMayo, List <string> vegetables)
 {
     _BreadType  = breadType;
     _IsToasted  = isToasted;
     _CheeseType = cheeseType;
     _MeatType   = meatType;
     _HasMustard = hasMustard;
     _HasMayo    = hasMayo;
     _Vegetables = vegetables;
 }
Ejemplo n.º 16
0
        public Cheese CreateCheese(string name, string description, CheeseType type, int rating)
        {
            Cheese newCheese = new Cheese
            {
                Name        = name,
                Description = description,
                Type        = type,
                Rating      = rating
            };

            return(newCheese);
        }
Ejemplo n.º 17
0
        public IActionResult Update(string id, CheeseType CheeseIn)
        {
            var Cheese = _cheeseTypeService.Get(id);

            if (Cheese == null)
            {
                return(NotFound());
            }

            _cheeseTypeService.Update(id, CheeseIn);

            return(NoContent());
        }
Ejemplo n.º 18
0
        public static Burger MakeBurger(CheeseType cheeseType, int cheeseQuantity, int meatQuantity)
        {
            var delay = ((cheeseType.GetHashCode() * cheeseQuantity) + meatQuantity) * 500;

            Thread.Sleep(delay);
            return(new Burger
            {
                Id = Guid.NewGuid(),
                Cheese = cheeseType,
                CheeseQuantity = cheeseQuantity,
                MeatQuantity = meatQuantity
            });
        }
Ejemplo n.º 19
0
        private int GetPriceForHundredGrammForCheeseType(
            CheeseType typeOfCheese)
        {
            int price = 0;

            switch (typeOfCheese)
            {
            case CheeseType.Tilsitter:
                price = 50;
                break;

            case CheeseType.CottageCheese:
                price = 10;
                break;

            case CheeseType.Edamer:
                price = 60;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(typeOfCheese));
            }
            return(price);
        }
Ejemplo n.º 20
0
        private int GetCaloriesOfHundredGrammForCheeseType(
            CheeseType typeOfCheese)
        {
            int calories = 0;

            switch (typeOfCheese)
            {
            case CheeseType.Tilsitter:
                calories = 70;
                break;

            case CheeseType.CottageCheese:
                calories = 87;
                break;

            case CheeseType.Edamer:
                calories = 110;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(typeOfCheese));
            }
            return(calories);
        }
Ejemplo n.º 21
0
 public LovelyCheese()
 {
     cheeseType = (CheeseType) Random.Range( 0, 3 );
 }
Ejemplo n.º 22
0
 public LovelyCheese()
 {
     cheeseType = (CheeseType)Random.Range(0, 3);
 }
Ejemplo n.º 23
0
 //smell - possibility of more than one constructor to deal with different possibilities
 //But hard to know which constructor
 public Sandwich(BreadType breadType, bool isToasted, CheeseType cheeseType)
 {
     BreadType  = breadType;
     IsToasted  = isToasted;
     CheeseType = cheeseType;
 }
Ejemplo n.º 24
0
 public CheeseType Create(CheeseType CheeseType)
 {
     _CheeseType.InsertOne(CheeseType);
     return(CheeseType);
 }
Ejemplo n.º 25
0
 public static CheesePhrase AddCheese(this IFoodProduct instance, CheeseType typeOfCheese)
 {
     return(new CheesePhrase(instance, typeOfCheese));
 }
Ejemplo n.º 26
0
 public void Update(string id, CheeseType CheeseTypeIn) =>
 _CheeseType.ReplaceOne(CheeseType => CheeseType.Id == id, CheeseTypeIn);
Ejemplo n.º 27
0
 public void Remove(CheeseType CheeseTypeIn) =>
 _CheeseType.DeleteOne(CheeseType => CheeseType.Id == CheeseTypeIn.Id);
Ejemplo n.º 28
0
 public Cheese Update(Cheese cheese, CheeseType type)
 {
     return(_updaters.FirstOrDefault(x => x.CheeseType == type)?.Update(cheese) ?? throw new ArgumentNullException(nameof(type)));
 }
Ejemplo n.º 29
0
 public abstract void AddCheese(CheeseType cheeseType);
Ejemplo n.º 30
0
 private Cheese(int amountOfHoles, string name, CheeseType type)
 {
     AmountOfHoles = amountOfHoles;
     Name          = name;
     CheeseType    = type;
 }
Ejemplo n.º 31
0
 public override void AddCheese(CheeseType cheeseType)
 {
     _sandwichRecipe.Cheese = cheeseType;
 }
Ejemplo n.º 32
0
        public ActionResult <CheeseType> Create(CheeseType cheeseType)
        {
            _cheeseTypeService.Create(cheeseType);

            return(CreatedAtRoute("GetCheeseType", new { id = cheeseType.Id.ToString() }, cheeseType));
        }