public void GetByIdAsync_WhenIdIsValid_ShouldReturnNotNullResult_Test() { // Arrange var sut = new DoctorRepository(this.GetDatabaseConnection(), this.converter, this.logger.Object); // Act var result = sut.GetByIdAsync("5a4143315725fe20903659cb").Result; // Assert Assert.NotNull(result); }
public void Given_DoctorRepository_When_ReturningADoctor_Then_TheDoctorShouldBeProperlyReturned() { RunOnDatabase(async ctx => { //Arrange var repository = new DoctorRepository(ctx); var doctor = Doctor.Create("1234", "Mircea", "Cartarescu", "*****@*****.**", "parola", "0746524459", "blasdadsadsada", "Cardiologie", "Sf. Spiridon", "Iasi", "Romania", "Str. Vasile Lupu", true); await repository.AddAsync(doctor); //Act var extractedDoctor = await repository.GetByIdAsync(doctor.DoctorId); //Assert Assert.AreEqual(doctor, extractedDoctor); }); }
public void Given_DoctorRepository_When_ReturningADoctor_Then_TheDoctorShouldBeProperlyReturned() { RunOnDatabase(async ctx => { //Arrange var repository = new DoctorRepository(ctx); var doctor = Doctor.Create("Daniel", "Oana", "*****@*****.**", "parola", "0746524459", "bla", "Cardiologie", "Sf. Spiridon", "Iasi", "Str. Vasile Lupu"); await repository.AddAsync(doctor); //Act var extractedDoctor = await repository.GetByIdAsync(doctor.DoctorId); //Assert Assert.AreEqual(doctor, extractedDoctor); }); }