Example #1
0
        public async Task HandleAsync_GivenMessage_ReturnsAllPanAreas()
        {
            var message = new GetPanAreas();

            var result = await handler.HandleAsync(message);

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

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

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

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