Esempio n. 1
0
        private async void ShouldFetchConsent()
        {
            var consentContext    = ConsentContext();
            var consentRepository = new ConsentRepository(consentContext);
            var consentAdded      = TestBuilder.Consent();
            await consentRepository.AddAsync(consentAdded);

            var consent = await consentRepository.GetFor(consentAdded.ConsentArtefactId);

            consent.Should().BeEquivalentTo(consentAdded);
        }
Esempio n. 2
0
        private async void ShouldReturnNullWhenConsentIsNotFound()
        {
            var consentContext    = ConsentContext();
            var consentRepository = new ConsentRepository(consentContext);
            var consentAdded      = TestBuilder.Consent();
            await consentRepository.AddAsync(consentAdded);

            var consent = await consentRepository.GetFor("not-found-consent-id");

            consent.Should().BeNull();
        }
Esempio n. 3
0
        private async void ShouldStoreConsent()
        {
            var consentContext    = ConsentContext();
            var consentRepository = new ConsentRepository(consentContext);

            consentContext.ConsentArtefact.Count().Should().Be(0);

            await consentRepository.AddAsync(TestBuilder.Consent());

            consentContext.ConsentArtefact.Count().Should().Be(1);
        }