コード例 #1
0
        private async void ReturnNullUnknownReferenceNumber()
        {
            var faker = TestBuilders.Faker();
            var linkReferenceNumber   = faker.Random.Hash();
            var dbContext             = PatientContext();
            var linkPatientRepository = new LinkPatientRepository(dbContext);

            var(result, exception) = await linkPatientRepository
                                     .GetPatientFor(linkReferenceNumber);

            result.Should().BeNull();
            exception.Should().NotBeNull();
            dbContext.Database.EnsureDeleted();
        }
コード例 #2
0
        private async void ShouldSaveLinkRequest()
        {
            var faker                 = TestBuilders.Faker();
            var dbContext             = PatientContext();
            var linkPatientRepository = new LinkPatientRepository(dbContext);
            var linkReferenceNumber   = faker.Random.Hash();

            var(link, _) = await linkPatientRepository.SaveRequestWith(linkReferenceNumber, faker.Random.Hash()
                                                                       , faker.Random.Hash(), faker.Random.Hash(),
                                                                       new[] { (faker.Random.Word()) });

            var(patientFor, _) = await linkPatientRepository.GetPatientFor(linkReferenceNumber);

            link.Should().BeEquivalentTo(patientFor);

            dbContext.Database.EnsureDeleted();
        }