상속: System.Entity
예제 #1
0
 protected IEnumerable<GenderNutrientRecommendation> GetGenderNutrientRecommendations(NutrientRecommendation nutrientRecommendation)
 {
     var manNutrientRecommendations = new GenderNutrientRecommendation {
         GenderType = man,
         NutrientRecommendation = nutrientRecommendation,
     };
     manNutrientRecommendations.GenderAgeRecommendations = GetAgeRecommendations(ManRecommendations, manNutrientRecommendations);
     var womanNutrientRecommendations = new GenderNutrientRecommendation {
         GenderType = woman,
         NutrientRecommendation = nutrientRecommendation
     };
     womanNutrientRecommendations.GenderAgeRecommendations = GetAgeRecommendations(WomanRecommendations, womanNutrientRecommendations);
     return new List<GenderNutrientRecommendation> { manNutrientRecommendations, womanNutrientRecommendations };
 }
        public void shouldGetNutrientRecommendation()
        {
            var expected = new NutrientRecommendation();
            var nutrientRecommendationRepositoryMock = new Mock<INutrientRecommendationRepository>();
            var nutrientBusinessLogicMock = new Mock<INutrientBusinessLogic>();
            var nutrientMock = new Mock<Nutrient>();
            var nutrientId = 2;
            nutrientMock.Setup(x => x.Id).Returns(nutrientId);
            nutrientBusinessLogicMock.Setup(x => x.GetNutrient(It.IsAny<NutrientEntity>())).Returns(nutrientMock.Object);
            nutrientRecommendationRepositoryMock.Setup(x => x.GetByNutrient(nutrientMock.Object)).Returns(expected);

            var result = new NutrientRecommendationBusinessLogic(nutrientBusinessLogicMock.Object, nutrientRecommendationRepositoryMock.Object).GetNutrientRecommendation(NutrientEntity.ZincInmG);
            Assert.That(result, Is.SameAs(expected));
        }
예제 #3
0
 protected NutrientRecommendation getNutrientRecommendation()
 {
     var nutrientRecommendation = new NutrientRecommendation {
         Nutrient = nutrient
     };
     nutrientRecommendation.GenderRecommendations = GetGenderNutrientRecommendations(nutrientRecommendation);
     return nutrientRecommendation;
 }