コード例 #1
0
        public void GetSupportedLanguages_Returns_Languages()
        {
            // Configure
            var ingredient = IngredientsHelper.GetIngredient();

            _mockILogger.Setup(x => x.Debug("Calling Get Ingredient By ID"));
            _mockIIngredientRepository.Setup(x => x.GetIngredientById(It.IsAny <long>())).ReturnsAsync(ingredient);

            // Act
            var ingredientService = new IngredientService(_mockIIngredientRepository.Object, _mockILogger.Object);
            var result            = ingredientService.GetIngredientById(1);

            // Assert
            _mockILogger.Verify(x => x.Debug("Calling Get Ingredient By ID"), Times.Once);
            _mockIIngredientRepository.Verify(x => x.GetIngredientById(It.IsAny <long>()), Times.Once);
            Assert.NotNull(result);
        }
コード例 #2
0
        public double CalcCalories()
        {
            double result = this.Weight * Constants.ToppingBaseCaloriesPerGram * IngredientsHelper.GetToppingModifier(this.Type);

            return(result);
        }
コード例 #3
0
        public double CalcCalogies()
        {
            double result = this.WeightGrams * Constants.DoughBaseCaloriesPerGram * IngredientsHelper.GetDoughModifier(this.flourType) * IngredientsHelper.GetDoughModifier(this.bakingTechnique);

            return(result);
        }