public BarcodeInfo(ProductSKUDto product, ProductPackingDto productPacking) { SKUCode = product.Code; SKUName = product.Name; PackingCode = productPacking.Code; PackingSize = productPacking.PackingSize; PackingType = productPacking.UOM.Unit; }
public void shouldSuccessInstantiate() { ProductSKUModel product = new ProductSKUModel("Code", "Name", 1, 1, "Description") { Id = 1, }; UnitOfMeasurementModel uom = new UnitOfMeasurementModel() { Id = 1 }; CategoryModel category = new CategoryModel("Name", "Code") { }; ProductSKUDto productSKUDto = new ProductSKUDto(product, uom, category) { Category = new CategoryDto(new CategoryModel("Name", "Code")) }; ProductPackingModel productPackingModel = new ProductPackingModel(1, 1, 1, "Code", "Name", "description") { }; ProductSKUModel productSKUModel = new ProductSKUModel("Code", "Name", 1, 1, "Description") { }; UnitOfMeasurementModel uomModel = new UnitOfMeasurementModel("Unit") { }; UnitOfMeasurementModel skuUOM = new UnitOfMeasurementModel(); CategoryModel skuCategory = new CategoryModel(); ProductPackingDto productPackingDto = new ProductPackingDto(productPackingModel, productSKUModel, uomModel, skuUOM, skuCategory); BarcodeInfo barcode = new BarcodeInfo(productSKUDto, productPackingDto); Assert.NotNull(barcode); Assert.Equal("Code", barcode.SKUCode); Assert.Equal("Name", barcode.SKUName); Assert.Equal("Code", barcode.PackingCode); Assert.Equal(1, barcode.PackingSize); Assert.Equal("Unit", barcode.PackingType); }
public void Should_Success_Instantiate() { ProductSKUDto dto = new ProductSKUDto(new ProductSKUModel("code", "name", 1, 1, "description") { LastModifiedUtc = DateTime.Now }, new UnitOfMeasurementModel("unit"), new CategoryModel("name", "code")); Assert.Equal("name", dto.Name); Assert.Equal("code", dto.Code); Assert.Equal("description", dto.Description); Assert.Equal(0, dto.Id); Assert.True(DateTime.MinValue < dto.LasModifiedUtc); Assert.NotNull(dto.UOM); Assert.NotNull(dto.Category); Assert.Equal(0, dto.UOMId); Assert.Equal("unit", dto.UOMUnit); }
public DocumentItemDto(ProductSKUInventoryMovementModel item, ProductSKUModel product, UnitOfMeasurementModel uom, CategoryModel category) { Product = new ProductSKUDto(product, uom, category); Quantity = item.Quantity; Remark = item.Remark; }