public GarmentAvalProductItemDto(GarmentAvalProductItem garmentAvalProductItem) { Id = garmentAvalProductItem.Identity; LastModifiedDate = garmentAvalProductItem.AuditTrail.ModifiedDate ?? garmentAvalProductItem.AuditTrail.CreatedDate; LastModifiedBy = garmentAvalProductItem.AuditTrail.ModifiedBy ?? garmentAvalProductItem.AuditTrail.CreatedBy; APId = garmentAvalProductItem.APId; PreparingId = new GarmentPreparing(garmentAvalProductItem.PreparingId.Value, "", ""); PreparingItemId = new GarmentPreparingItem(garmentAvalProductItem.PreparingItemId.Value, null, "", 0); Product = new Product(garmentAvalProductItem.ProductId.Value, garmentAvalProductItem.ProductName, garmentAvalProductItem.ProductCode); DesignColor = garmentAvalProductItem.DesignColor; Quantity = garmentAvalProductItem.Quantity; Uom = new Uom(garmentAvalProductItem.UomId.Value, garmentAvalProductItem.UomUnit); BasicPrice = garmentAvalProductItem.BasicPrice; IsReceived = garmentAvalProductItem.IsReceived; }
public void should_success_instantiate() { Guid id = Guid.NewGuid(); GarmentAvalProductItem productItem = new GarmentAvalProductItem(new GarmentAvalProductItemReadModel(id)); productItem.setDesignColor("designCollor"); productItem.SetIsReceived(true); productItem.setPreparingId(new GarmentPreparingId("value")); productItem.setPreparingItemId(new GarmentPreparingItemId("value")); productItem.setProductCode("code"); productItem.setProductId(new ProductId(1)); productItem.setProductName("newProductName"); productItem.setQuantity(1); productItem.setUomId(new UomId(1)); productItem.setUomUnit("newUomUnit"); productItem.SetDeleted(); Assert.NotNull(productItem); }