Ejemplo n.º 1
0
 public void Initialize()
 {
     medicalCondition = new MedicalCondition()
     {
         Id   = 1,
         Name = "Dormir"
     };
     secondMedicalCondition = new MedicalCondition()
     {
         Id   = 2,
         Name = "Musica"
     };
     medicalConditionList = new List <MedicalCondition>();
     medicalConditionList.Add(medicalCondition);
     medicalConditionList.Add(secondMedicalCondition);
     repository = new Mock <IData <MedicalCondition> >();
     repository.Setup(r => r.GetAll()).Returns(medicalConditionList);
     repository.Setup(play => play.Get(1)).Returns(medicalCondition);
     repository.Setup(play => play.Add(medicalCondition));
     medicalConditionLogic = new MedicalConditionLogic(repository.Object);
 }
        public void Initialize()
        {
            psychologistList = new List <Psychologist>();
            List <Expertise> expertiseList = new List <Expertise>();

            medicalConditionList = new List <MedicalCondition>();
            MedicalCondition medicalCondition = new MedicalCondition()
            {
                Id   = 1,
                Name = "Depresion"
            };

            medicalConditionList.Add(medicalCondition);
            psychologist = new Psychologist
            {
                Name         = "Mauro",
                Id           = 1,
                MeetingType  = meetingType.Virtual,
                MeetingPrice = meetingPrice.UY1000,
                Expertise    = new List <Expertise>(),
                Meeting      = new List <Meeting>()
            };
            Expertise expertise = new Expertise()
            {
                IdMedicalCondition = medicalCondition.Id,
                MedicalCondition   = medicalCondition,
                IdPsychologist     = psychologist.Id,
                Psychologist       = psychologist
            };

            user = new User()
            {
                Id               = 1,
                Name             = "Rodrigo",
                Surname          = "Hirigoyen",
                Cellphone        = "099925927",
                Email            = "*****@*****.**",
                Meeting          = new List <Meeting>(),
                Birthday         = new DateTime(2000, 01, 01),
                MedicalCondition = medicalCondition,
            };

            expertiseList.Add(expertise);
            psychologist.Expertise     = expertiseList;
            medicalCondition.Expertise = expertiseList;
            psychologistList.Add(psychologist);
            userList.Add(user);

            repositoryPsychologist     = new Mock <IData <Psychologist> >();
            repositoryMedicalCondition = new Mock <IData <MedicalCondition> >();
            repositoryUser             = new Mock <IData <User> >();

            repositoryMedicalCondition.Setup(py => py.GetAll()).Returns(medicalConditionList);
            repositoryPsychologist.Setup(r => r.GetAll()).Returns(psychologistList);
            repositoryPsychologist.Setup(py => py.Get(1)).Returns(psychologist);
            repositoryUser.Setup(py => py.Get(1)).Returns(user);
            repositoryMedicalCondition.Setup(py => py.Get(1)).Returns(medicalCondition);
            repositoryPsychologist.Setup(py => py.Add(psychologist));


            psychologistLogic     = new PsychologistLogic(repositoryPsychologist.Object, repositoryMedicalCondition.Object);
            medicalConditionLogic = new MedicalConditionLogic(repositoryMedicalCondition.Object);
            userLogic             = new UserLogic(repositoryUser.Object, repositoryMedicalCondition.Object, repositoryPsychologist.Object);
        }