public Ingredient GetIngredient(IngredientTypes ingredient, Places place) { log += "GetIngredient: " + ingredient.ToString() + " place: " + place.ToString(); return(new Ingredient(false)); }
private void Add() { if (!string.IsNullOrEmpty(NewIngredientText)) { IngredientTypes ingredientType = IsNewSingular ? IngredientTypes.Singular : IngredientTypes.Measured; _groceryListRepo.AddIngredient(new Ingredient() { Name = NewIngredientText, Type = ingredientType }); Refresh(); } }
public void IngredientTypesToIngredientTpye() { IngredientType ingredientType = new IngredientType { Id = 1, Name = "Name", }; IngredientTypes ingredientTypes = mapper.MapIngredientType(ingredientType); Assert.Equal(ingredientType.Id, ingredientTypes.Id); Assert.Equal(ingredientType.Name, ingredientTypes.Name); }
public async Task Seed() { if (!await Users.AnyAsync()) { var data = new DataSamples(); await Users.AddRangeAsync(data.Users.Select(u => u.Item1).ToArray()); await IngredientTypes.AddRangeAsync(data.IngredientTypes); await Recipes.AddRangeAsync(data.Recipes); await SaveChangesAsync(); } }
// Increase the number of an ingredient dispensed public void increaseIngredientDispensed(IngredientTypes dispensedIngredient, int increaseAmount) { // Depending on the dispensed ingredient chosen // Increase the amount of that ingredient that is dispensed if (dispensedIngredient == IngredientTypes.BlueDiamond) { setDispensedBlueDiamond(getDispensedBlueDiamond() + increaseAmount); print(dispensedIngredient.ToString() + " : " + getDispensedBlueDiamond()); } else if (dispensedIngredient == IngredientTypes.MagicGrape) { setDispensedMagicGrape(getDispensedMagicGrape() + increaseAmount); print(dispensedIngredient.ToString() + " : " + getDispensedMagicGrape()); } else if (dispensedIngredient == IngredientTypes.RedSugar) { setDispensedRedSugar(getDispensedRedSugar() + increaseAmount); print(dispensedIngredient.ToString() + " : " + getDispensedRedSugar()); } }
public async Task GetIngredientTypesAsyncGets() { var options = new DbContextOptionsBuilder <Project2JAGVContext>() .UseInMemoryDatabase("GetIngredientsAsyncGets") .Options; IngredientTypes ingredientTypes = new IngredientTypes { Id = 1, Name = "name", }; using var arrangeContext = new Project2JAGVContext(options); arrangeContext.Add(ingredientTypes); arrangeContext.SaveChanges(); using var actContext = new Project2JAGVContext(options); var repo = new DataAccess.DataAccess(actContext, new MapperStub()); var result = await repo.GetIngredientTypesAsync(); Assert.NotNull(result); }
public IngredientType MapIngredientType(IngredientTypes ingredientType) { return(new IngredientType()); }
// Directed implementation outwards. private Ingredient GetIngredient(IngredientTypes ingredient, Places place) { return(dispenser.GetIngredient(ingredient, place)); }
// TODO: Add more implementation private Ingredient GetIngredient(IngredientTypes ingredient, Places place) { return(new Ingredient(false)); }