Пример #1
0
        private static IOperationRepository CreateOperationStubRepository()
        {
            var stubRepository = new Mock <IOperationRepository>();

            var patientOperations = new List <Operation>();
            var doctorOperations  = new List <Operation>();

            OperationReferral referral1 = new OperationReferral(1, "diagnosis", "procedure", 1);
            OperationReferral referral2 = new OperationReferral(2, "diagnosis", "procedure", 1);;
            var referrals = new List <OperationReferral>();

            referrals.Add(referral1);
            referrals.Add(referral1);

            Operation operation1 = new Operation(1, 2, "03/03/2020", new TimeSpan(0, 14, 0, 0), new TimeSpan(0, 15, 0, 0, 0), 1, "room1");
            Operation operation2 = new Operation(2, 1, "03/10/2020", new TimeSpan(0, 15, 0, 0), new TimeSpan(0, 15, 15, 0, 0), 2, "room1");

            patientOperations.Add(operation1);
            doctorOperations.Add(operation2);

            stubRepository.Setup(m => m.GetOperationsForPatient(2)).Returns(patientOperations);
            stubRepository.Setup(m => m.GetOperationsForDoctor(2)).Returns(doctorOperations);
            stubRepository.Setup(m => m.GetOperationsForDoctor(1)).Returns(new List <Operation>());
            stubRepository.Setup(m => m.GetOperationsForDoctor(3)).Returns(new List <Operation>());

            return(stubRepository.Object);
        }
Пример #2
0
        private static IOperationRepository CreateOperationStubRepository()
        {
            var stubRepository = new Mock <IOperationRepository>();

            var patientOperations = new List <Operation>();
            var doctorOperations  = new List <Operation>();

            OperationReferral referral1 = new OperationReferral(1, "Medicine", "Take medicine until", 3, "classify", "comment", 1);
            OperationReferral referral2 = new OperationReferral(2, "Medicine2", "Take medicine until", 3, "Appointment", "comment", 1);
            var referrals = new List <OperationReferral>();

            referrals.Add(referral1);
            referrals.Add(referral1);

            Operation operation1 = new Operation(1, 1, "03/03/2020", new TimeSpan(0, 14, 0, 0), new TimeSpan(0, 15, 0, 0, 0), 1, "room1");
            Operation operation2 = new Operation(2, 1, "03/10/2020", new TimeSpan(0, 15, 0, 0), new TimeSpan(0, 15, 15, 0, 0), 2, "room1");

            patientOperations.Add(operation1);
            doctorOperations.Add(operation2);

            stubRepository.Setup(m => m.GetOperationsForPatient(2)).Returns(patientOperations);
            stubRepository.Setup(m => m.GetOperationsForDoctor(2)).Returns(doctorOperations);
            stubRepository.Setup(m => m.GetOperationsForDoctor(1)).Returns(new List <Operation>());
            stubRepository.Setup(m => m.GetOperationsForDoctor(3)).Returns(new List <Operation>());

            return(stubRepository.Object);
        }
Пример #3
0
 public OperationDto(string doctorNameAndSurname, OperationReferral referral, string date)
 {
     DoctorNameAndSurname = doctorNameAndSurname;
     OperationReferral    = referral;
     Date = date;
 }