Пример #1
0
        public async Task HandleAsync_GivenGetSentOnAatfSiteRequest_DataAccessIsCalled()
        {
            var id = Guid.NewGuid();

            await handler.HandleAsync(new GetSentOnAatfSite(id));

            A.CallTo(() => sentOnDataAccess.GetWeeeSentOnSiteAddress(id)).MustHaveHappened(Repeated.Exactly.Once);
        }
Пример #2
0
        public async Task HandleAsync_NoExternalAccess_ThrowsSecurityException()
        {
            var authorization = new AuthorizationBuilder().DenyExternalAreaAccess().Build();

            var handler = new GetSentOnAatfSiteHandler(authorization, sentOnDataAccess, mapper);

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

            await action.Should().ThrowAsync<SecurityException>();
        }