Пример #1
0
		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);
		}
Пример #2
0
			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))
				};
			}
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
 public List <Ingredient> GetIngredientList(DTOSize size)
 {
     return(ingredientListFeedBack.GetIngredientList(size));
 }
Пример #6
0
 public List <Size> DeleteSize(Size size)
 {
     sizeList.DeleteSize(size);
     return(sizes);
 }
Пример #7
0
 public List <Size> UpdateSize(Size size)
 {
     sizeList.UpdateSize(size);
     return(sizes);
 }
Пример #8
0
 public List <Size> AddSize(Size size)
 {
     sizeList.AddSize(size);
     return(sizes);
 }
Пример #9
0
 public List <Ingredient> GetIngredientList(Size size)
 {
     return(ingredientList.GetIngredientList(size));
 }