public BarcodeInfo(ProductSKUDto product, ProductPackingDto productPacking)
 {
     SKUCode     = product.Code;
     SKUName     = product.Name;
     PackingCode = productPacking.Code;
     PackingSize = productPacking.PackingSize;
     PackingType = productPacking.UOM.Unit;
 }
예제 #2
0
        public void Should_Success_Instantiate()
        {
            ProductPackingDto dto = new ProductPackingDto(new ProductPackingModel(1, 1, 1, "code", "name", "description")
            {
                LastModifiedUtc = DateTime.Now
            }, new ProductSKUModel(), new UnitOfMeasurementModel(), new UnitOfMeasurementModel(), new CategoryModel());

            Assert.Equal("name", dto.Name);
            Assert.Equal("code", dto.Code);
            Assert.Equal(0, dto.Id);
            Assert.True(DateTime.MinValue < dto.LasModifiedUtc);
            Assert.NotNull(dto.ProductSKU);
            Assert.NotNull(dto.UOM);
        }
예제 #3
0
        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);
        }