public AdminController()
 {
     _doctorRepository           = new DoctorRepository();
     _hospitalRepository         = new HospitalRepository();
     _bankRepository             = new BankRepository();
     _agencyRepository           = new AgencyRepository();
     _specialityRepository       = new SpecialityRepository();
     _payRateRepository          = new PayRateRepository();
     _companionTypeRepository    = new CompanionTypeRepository();
     _companionHistoryRepository = new CompanionHistoryRepository();
     _patientHistoryRepository   = new PatientHistoryRepository();
 }
        public void Given_PatientHistoryRepository_When_AddAsyncingAPatientHistory_Then_ThePatientHistoryShouldBeProperlySaved()
        {
            var doctor  = Doctor.Create("Daniel", "Oana", "*****@*****.**", "parola", "0746524459", "ads", "Cardiologie", "Sf. Spiridon", "Iasi", "Str. Vasile Lupu");
            var patient = Patient.Create("Roland", "Iordache", "*****@*****.**", "asfdsdssd", "Iasi", new DateTime(1996, 02, 10), "0746524459", null);

            RunOnDatabase(async ctx => {
                //Arrange
                var repository     = new PatientHistoryRepository(ctx);
                var patientHistory = PatientHistory.Create(patient, doctor, "Paracetamol", "Febra", "Odihna", new DateTime(1996, 02, 10));

                //Act
                await repository.AddAsync(patientHistory);

                //Assert
                Assert.AreEqual(repository.GetAllAsync().Result.Count, 1);
            });
        }
예제 #3
0
        public void Given_PatientHistoryRepository_When_AddAsyncingAPatientHistory_Then_ThePatientHistoryShouldBeProperlySaved()
        {
            var patient = Patient.Create("1234", "Roland", "Iordache", "*****@*****.**", "asfdsdssd", "Iasi", "Romania", new DateTime(1996, 02, 10), "0746524459", null);
            var doctor  = Doctor.Create("1234", "Mircea", "Cartarescu", "*****@*****.**", "parola", "0746524459", "blasdadsadsada", "Cardiologie", "Sf. Spiridon", "Iasi", "Romania", "Str. Vasile Lupu", true);

            RunOnDatabase(async ctx => {
                //Arrange
                var repository     = new PatientHistoryRepository(ctx);
                var patientHistory = PatientHistory.Create(patient.PatientId);

                //Act
                await repository.AddAsync(patientHistory);

                //Assert
                string[] includes = { " " };
                Assert.AreEqual(repository.GetAllAsync(includes).Result.Count, 1);
            });
        }
예제 #4
0
        public void Given_PatientHistoryRepository_When_ReturningAPatientHistory_Then_ThePatientHistoryShouldBeProperlyReturned()
        {
            var patient = Patient.Create("1234", "Roland", "Iordache", "*****@*****.**", "asfdsdssd", "Iasi", "Romania", new DateTime(1996, 02, 10), "0746524459", null);
            var doctor  = Doctor.Create("1234", "Mircea", "Cartarescu", "*****@*****.**", "parola", "0746524459", "blasdadsadsada", "Cardiologie", "Sf. Spiridon", "Iasi", "Romania", "Str. Vasile Lupu", true);


            RunOnDatabase(async ctx => {
                //Arrange
                var repository     = new PatientHistoryRepository(ctx);
                var patientHistory = PatientHistory.Create(patient.PatientId);
                await repository.AddAsync(patientHistory);

                //Act
                var extractedPatientHistory = await repository.GetByIdAsync(patientHistory.HistoryId);

                //Assert
                Assert.AreEqual(patientHistory, extractedPatientHistory);
            });
        }