public void GetIngredientListReturnsListFromDependency() { var size = new DTOSize(1, "1", new Money(1), new DTOPosition(1, "1", "1") ); var ingredientListStub = new IngredientListStub(); var ingredientListValidator = new IngredientListValidator(ingredientListStub); var expected = ingredientListStub.GetIngredientList(size); var actual = ingredientListValidator.GetIngredientList(size); Assert.AreEqual(expected[0], actual[0]); Assert.AreEqual(expected[1], actual[1]); Assert.AreEqual(expected.Count, actual.Count); }
public List<DTOIngredient> GetIngredientList(DTOSize size) { var sizes = new List<DTOSize>() { new DTOSize(1, "1", new Money(1), new DTOPosition(1, "1", "1")) }; var foundSize = sizes.First(p => p == size); return new List<DTOIngredient>() { new DTOIngredient(1, 1, size, new DTOConsumable(1, "water", 1)), new DTOIngredient(2, 2, size, new DTOConsumable(2, "sugar", 1)) }; }
public void DoesSizeNameExist_DTOList() { var size1 = new DTOSize(1, "1", new Money(1), new DTO.Position(1, "1", "1")); var size2 = new DTOSize(2, "2", new Money(1), new DTO.Position(1, "1", "1")); var size3 = new DTOSize(1, "2", new Money(1), new DTO.Position(1, "1", "1")); var sizes = new List <DTOSize>() { size1, size2 }; var result = Size.DoesSizeNameExist(size3, sizes, out var error); Assert.IsTrue(result); Assert.AreEqual($"Name {size3.Name} is already taken", error); }
public void DoesSizeExistFail_DTOList() { var size1 = new DTOSize(1, "1", new Money(1), new DTO.Position(1, "1", "1")); var size2 = new DTOSize(2, "2", new Money(1), new DTO.Position(1, "1", "1")); var size3 = new DTOSize(3, "3", new Money(1), new DTO.Position(1, "1", "1")); var sizes = new List <DTOSize>() { size1, size2 }; var result = Size.DoesSizeExist(size3, sizes, out var error); Assert.IsFalse(result); Assert.AreEqual($"Size {size3.Name} cannot be found", error); }
public List <Ingredient> GetIngredientList(DTOSize size) { return(ingredientListFeedBack.GetIngredientList(size)); }
public List <Size> DeleteSize(Size size) { sizeList.DeleteSize(size); return(sizes); }
public List <Size> UpdateSize(Size size) { sizeList.UpdateSize(size); return(sizes); }
public List <Size> AddSize(Size size) { sizeList.AddSize(size); return(sizes); }
public List <Ingredient> GetIngredientList(Size size) { return(ingredientList.GetIngredientList(size)); }