public async Task HandleAsync_UserIsNotAuthorized_ThrowsSecurityException_AndDoesNotUseDataAccess()
        {
            A.CallTo(() => authorization.EnsureCanAccessInternalArea())
            .Throws <SecurityException>();

            await
            Assert.ThrowsAsync <SecurityException>(
                () => Handler().HandleAsync(A.Dummy <GetMemberRegistrationsActiveComplianceYears>()));

            A.CallTo(() => dataAccess.Get())
            .MustNotHaveHappened();
        }
Esempio n. 2
0
        public async Task <List <int> > HandleAsync(GetMemberRegistrationsActiveComplianceYears message)
        {
            authorization.EnsureCanAccessInternalArea();

            return(await dataAccess.Get());
        }