Ejemplo n.º 1
0
        public void CheckExistingIngredientIdShouldWorkProperly(int firstId, int secondId, bool expectedResult)
        {
            var ingredientTypeRepository = new Mock <IRepository <IngredientType> >();
            var ingredientRepository     = new Mock <IRepository <Ingredient> >();

            ingredientRepository.Setup(x => x.All()).Returns(this.DummyDataIngredient().AsQueryable());
            var service = new IngredientService(ingredientTypeRepository.Object, ingredientRepository.Object);

            var ids = new List <int> {
                firstId, secondId
            };
            var actualResult = service.CheckExistingIngredientId(ids);

            Assert.True(actualResult == expectedResult, $"Check Existing Ingredients Id should return {expectedResult} with Data: {firstId}, {secondId}.");
        }