public async Task <IActionResult> Put(string id, [FromBody] UpdateGarmentLoadingCommand command)
        {
            Guid guid = Guid.Parse(id);

            command.SetIdentity(guid);

            VerifyUser();

            var order = await Mediator.Send(command);

            return(Ok(order.Identity));
        }
        public async Task Handle_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            Guid loadingGuid      = Guid.NewGuid();
            Guid sewingDOItemGuid = Guid.NewGuid();
            Guid sewingDOGuid     = Guid.NewGuid();
            UpdateGarmentLoadingCommandHandler unitUnderTest        = CreateUpdateGarmentLoadingCommandHandler();
            CancellationToken           cancellationToken           = CancellationToken.None;
            UpdateGarmentLoadingCommand UpdateGarmentLoadingCommand = new UpdateGarmentLoadingCommand()
            {
                RONo        = "RONo",
                Unit        = new UnitDepartment(1, "UnitCode", "UnitName"),
                LoadingDate = DateTimeOffset.Now,
                Article     = "Article",
                SewingDOId  = sewingDOGuid,
                UnitFrom    = new UnitDepartment(1, "UnitCode", "UnitName"),
                Comodity    = new GarmentComodity(1, "ComoCode", "ComoName"),
                Items       = new List <GarmentLoadingItemValueObject>
                {
                    new GarmentLoadingItemValueObject
                    {
                        IsSave                    = true,
                        SewingDOItemId            = sewingDOItemGuid,
                        Size                      = new SizeValueObject(1, "Size"),
                        Quantity                  = 1,
                        RemainingQuantity         = 1,
                        SewingDORemainingQuantity = 2,
                        Product                   = new Product(1, "ProdCode", "ProdName"),
                        Uom = new Uom(1, "Uom"),
                    }
                },
            };

            UpdateGarmentLoadingCommand.SetIdentity(loadingGuid);

            _mockLoadingRepository
            .Setup(s => s.Query)
            .Returns(new List <GarmentLoadingReadModel>()
            {
                new GarmentLoadingReadModel(loadingGuid)
            }.AsQueryable());
            _mockLoadingItemRepository
            .Setup(s => s.Find(It.IsAny <Expression <Func <GarmentLoadingItemReadModel, bool> > >()))
            .Returns(new List <GarmentLoadingItem>()
            {
                new GarmentLoadingItem(Guid.Empty, Guid.Empty, sewingDOItemGuid, new SizeId(1), null, new ProductId(1), null, null, null, 1, 1, 10, new UomId(1), null, null, 1)
            });

            _mockSewingDOItemRepository
            .Setup(s => s.Query)
            .Returns(new List <GarmentSewingDOItemReadModel>
            {
                new GarmentSewingDOItemReadModel(sewingDOItemGuid)
            }.AsQueryable());

            _mockLoadingRepository
            .Setup(s => s.Update(It.IsAny <GarmentLoading>()))
            .Returns(Task.FromResult(It.IsAny <GarmentLoading>()));
            _mockLoadingItemRepository
            .Setup(s => s.Update(It.IsAny <GarmentLoadingItem>()))
            .Returns(Task.FromResult(It.IsAny <GarmentLoadingItem>()));
            _mockSewingDOItemRepository
            .Setup(s => s.Update(It.IsAny <GarmentSewingDOItem>()))
            .Returns(Task.FromResult(It.IsAny <GarmentSewingDOItem>()));

            _MockStorage
            .Setup(x => x.Save())
            .Verifiable();

            // Act
            var result = await unitUnderTest.Handle(UpdateGarmentLoadingCommand, cancellationToken);

            // Assert
            result.Should().NotBeNull();
        }