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

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

            A.CallTo(() => dataAccess.GetContact(id)).MustHaveHappened(Repeated.Exactly.Once);
        }
Пример #2
0
        public async Task <AatfContactData> HandleAsync(GetAatfContact message)
        {
            authorization.EnsureCanAccessInternalArea();

            var contact = await dataAccess.GetContact(message.AatfId);

            var result = mapper.Map(contact);

            result.CanEditContactDetails = authorization.CheckUserInRole(Roles.InternalAdmin);

            return(result);
        }