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