Ejemplo n.º 1
0
        public void Check_custom_price_tag_address()
        {
            var address = new Address("Тестовый адрес");
            var lines   = new List <TagPrintable>();
            var line    = new TagPrintable()
            {
                AddressName = "Тестовый измененный адрес",
                ClientName  = "Тестовый клиент",
                Nds         = 10,
                RetailCost  = 251.20m,
                Product     = "Диклофенак",
                Quantity    = 1
            };

            lines.Add(line);

            var priceTagSettings = new PriceTagSettings()
            {
                Type    = PriceTagType.Custom,
                Address = address
            };
            var priceTag = PriceTag.Default(TagType.PriceTag, address);
            var doc      = new PriceTagDocument(lines, priceTagSettings, priceTag).Build();

            Assert.IsNotNull(doc);

            var text = doc.Descendants <StackPanel>()
                       .First()
                       .Descendants <Label>()
                       .First()
                       .Content.ToString().Trim();

            Assert.AreEqual($"{line.ClientName}, {line.AddressName}", text);
        }
Ejemplo n.º 2
0
        public void Print_price_tag()
        {
            var address = new Address("Тестовый");
            var lines   = new List <TagPrintable>();
            var line    = new TagPrintable()
            {
                Nds        = 10,
                RetailCost = 251.20m,
                Product    = "Диклофенак",
                Quantity   = 1
            };

            lines.Add(line);

            var priceTagSettings = new PriceTagSettings()
            {
                Type = PriceTagType.Normal
            };
            var doc = new PriceTagDocument(lines, priceTagSettings, null).Build();

            Assert.IsNotNull(doc);

            var priceTag = PriceTag.Default(TagType.RackingMap, null);
            var settings = new Settings(address);

            settings.RackingMap.Size = RackingMapSize.Custom;
            var doc2 = new RackingMapDocument(lines, settings, priceTag).Build();

            Assert.IsNotNull(doc2);
        }
 public void Reset()
 {
     Tag.Value = PriceTag.Default(tagType, address);
 }