コード例 #1
0
        public async Task HandleAsync_GivenMessage_ReturnsAllLocalAreas()
        {
            var message = new GetLocalAreas();

            var result = await handler.HandleAsync(message);

            result.Count.Should().Be(4);
        }
コード例 #2
0
        public async Task HandleAsync_NoInternallAccess_ThrowsSecurityException()
        {
            var authorization = new AuthorizationBuilder().DenyInternalAreaAccess().Build();

            handler = new GetLocalAreasHandler(A.Fake <WeeeContext>(), authorization, mapper);

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

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