Пример #1
0
        public void cantidadPlatosTest()
        {
            Mock <INutritionistRepository> nutritionistRepository = new Mock <INutritionistRepository>();

            nutritionistRepository.Setup(u => u.Listar()).Returns(this.nutritionists);

            var servicio = new NutritionistService();

            servicio.setNutritionist(nutritionistRepository.Object);
            var respuesta = servicio.cantidadPlatosPermi(plan);

            Assert.IsTrue(respuesta);
        }
Пример #2
0
        public void actualizarEstado()
        {
            Mock <INutritionistRepository> nutritionistRepository = new Mock <INutritionistRepository>();

            nutritionistRepository.Setup(u => u.Listar()).Returns(this.nutritionists);


            Mock <IStateRepository> stateRepository = new Mock <IStateRepository>();

            stateRepository.Setup(m => m.Insertar(It.IsAny <State>()));

            var servicio = new NutritionistService();

            servicio.setNutritionist(nutritionistRepository.Object);
            servicio.setState(stateRepository.Object);

            var resultado = servicio.actualizarEstado(users[0], estadoG, plan);

            Assert.IsTrue(resultado);
        }
Пример #3
0
        public void Editar_PerfilTest()
        {
            Mock <INutritionistRepository> nutritionistRepository = new Mock <INutritionistRepository>();

            nutritionistRepository.Setup(u => u.Listar()).Returns(this.nutritionists);

            var servicio = new NutritionistService();

            servicio.setNutritionist(nutritionistRepository.Object);

            var nutritionist = new Nutritionist()
            {
                Id       = 1,
                Name     = "nutri1",
                LastName = "nutri1_Last",
                Email    = "*****@*****.**",
                Password = "******",
                Validate = true
            };
            var resultado = servicio.letModificarPerfil(nutritionist, "4334");

            Assert.IsTrue(resultado);
        }
Пример #4
0
        public void EmailNutritionistTest()
        {
            Mock <INutritionistRepository> nutritionistRepository = new Mock <INutritionistRepository>();

            nutritionistRepository.Setup(u => u.Listar()).Returns(this.nutritionists);

            var servicio = new NutritionistService();

            servicio.setNutritionist(nutritionistRepository.Object);

            var nutritionist = new Nutritionist()
            {
                Id       = 2,
                Name     = "nutri4",
                LastName = "nutri445_Last",
                Email    = "*****@*****.**",
                Password = "******",
                Validate = true
            };
            var resultado = servicio.Insertar(nutritionist);

            Assert.IsTrue(resultado);
        }
Пример #5
0
 public ArticleController()
 {
     articleService      = new ArticleService();
     nutritionistService = new NutritionistService();
     userService         = new UserService();
 }
 public NutritionistController()
 {
     nutritionistService = new NutritionistService();
     userService         = new UserService();
 }
Пример #7
0
 public UserController(IConfiguration config)
 {
     userService         = new UserService();
     nutritionistService = new NutritionistService();
     _config             = config;
 }
Пример #8
0
 public CommentController()
 {
     commentService      = new CommentService();
     userService         = new UserService();
     nutritionistService = new NutritionistService();
 }