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); }
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); }
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); }
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); }
public ArticleController() { articleService = new ArticleService(); nutritionistService = new NutritionistService(); userService = new UserService(); }
public NutritionistController() { nutritionistService = new NutritionistService(); userService = new UserService(); }
public UserController(IConfiguration config) { userService = new UserService(); nutritionistService = new NutritionistService(); _config = config; }
public CommentController() { commentService = new CommentService(); userService = new UserService(); nutritionistService = new NutritionistService(); }