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); }); }
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); }); }