public async Task <ActionResult> CreateAssignmentToPointOfSale(AssignmentToPointOfSaleDto assignmentDto)
        {
            await _posAuthLoader.AssertResourceAccessAsync(User, assignmentDto.PointOfSaleId, IsAuthorizedUserPolicy.Instance);

            var command = new CreateAssignmentToPointOfSale(Guid.NewGuid(), assignmentDto.MeansId, assignmentDto.ValidSince, assignmentDto.ValidUntil, assignmentDto.PointOfSaleId);

            return(await SendAndHandleIdentifierResultCommand(command, nameof(GetAssignmentToPointOfSale)));
        }
Example #2
0
        public void GetAssignment_ConstructsQuery_ReturnsResultOfDispatch()
        {
            var assignmentId = TestIds.A;
            var result       = new AssignmentToPointOfSaleDto();

            _dispatcherMock.Setup(d => d.QueryAsync(It.Is <GetAssignmentToPointOfSale>(q => q.Id == assignmentId))).ReturnsAsync(result).Verifiable();

            var actionResult = _controller.GetAssignment(assignmentId).GetAwaiter().GetResult();

            Assert.AreEqual(actionResult.Value, result);
            _dispatcherMock.Verify();
        }