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 Build_all_tags()
        {
            var lines = new List <TagPrintable>();

            for (var i = 0; i < 25; i++)
            {
                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);
            Assert.AreEqual(2, doc.Pages.Count);

            var page1 = doc.Pages[0].Child;

            Assert.AreEqual(24, page1.Descendants <Grid>().First().Children.Count);
            var page2 = doc.Pages[1].Child;

            Assert.AreEqual(1, page2.Descendants <Grid>().First().Children.Count);
        }
Ejemplo n.º 3
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);
        }