コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            });
        }
コード例 #3
0
        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);
            });
        }