public void UpdatePsychologistNotCorrect()
        {
            Psychologist newPsychologist = new Psychologist()
            {
                Id        = 1,
                Name      = "",
                Expertise = new List <Expertise>(),
                Meeting   = new List <Meeting>()
            };
            var mockPsychologist = new Mock <IPsychologistLogic>(MockBehavior.Strict);

            mockPsychologist.Setup(l => l.Get(psychologistList[0].Id)).Returns(psychologistList[0]);
            mockPsychologist.Setup(l => l.Update(psychologistList[0], 1)).Throws(new FieldEnteredNotCorrect(""));
            var controller = new PsychologistController(mockPsychologist.Object);
            var result     = controller.UpdatePsychologist(1, newPsychologist);

            Assert.AreEqual(new UnprocessableEntityObjectResult("").ToString(),
                            result.ToString());
        }
        public void UpdatePsychologist()
        {
            Psychologist newPsychologist = new Psychologist()
            {
                Name      = "PEPErulo",
                Expertise = new List <Expertise>(),
                Meeting   = new List <Meeting>()
            };
            var mockPsychologist = new Mock <IPsychologistLogic>(MockBehavior.Strict);

            mockPsychologist.Setup(l => l.Get(psychologistList[0].Id)).Returns(psychologistList[0]);
            mockPsychologist.Setup(l => l.Add(psychologistList[0]));
            var controller = new PsychologistController(mockPsychologist.Object);

            psychologistList[0].Name      = newPsychologist.Name;
            psychologistList[0].Expertise = newPsychologist.Expertise;
            psychologistList[0].Meeting   = newPsychologist.Meeting;

            var result = controller.UpdatePsychologist(psychologistList[0].Id, psychologistList[0]);

            Assert.AreEqual(new ObjectResult("Updated successfully").ToString(),
                            result.ToString());
        }