public async Task HandleAsync_GivenMessage_ReturnsAllLocalAreas() { var message = new GetLocalAreas(); var result = await handler.HandleAsync(message); result.Count.Should().Be(4); }
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>(); }