Beispiel #1
0
        public async Task HandleAsync_NoInternalAccess_ThrowsSecurityException()
        {
            var authorization = new AuthorizationBuilder().DenyInternalAreaAccess().Build();

            handler = new GetAatfIdByComplianceYearHandler(authorization, dataAccess);

            Func <Task> action = async() => await handler.HandleAsync(A.Dummy <GetAatfIdByComplianceYear>());

            await action.Should().ThrowAsync <SecurityException>();
        }
Beispiel #2
0
        public async Task HandleAsync_GivenRequest_GetAatfIdShouldBeCalled()
        {
            var result = await handler.HandleAsync(A.Dummy <GetAatfIdByComplianceYear>());

            A.CallTo(() => dataAccess.GetAatfByAatfIdAndComplianceYear(A.Dummy <Guid>(), A.Dummy <short>())).MustHaveHappened(Repeated.Exactly.Once);
        }