public void ZebraZC3_PrintNameOnCard()
        {
            //Zebra.Sdk.Comm.ConnectionException
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();

                ProductField nameOnCardField = new ProductField
                {
                    Deleted       = false,
                    Printable     = true,
                    X             = 500,
                    Y             = 200,
                    Value         = Encoding.UTF8.GetBytes("DANIEL JACOB"),
                    Font          = "Consolas",
                    FontColourRGB = Color.Black.ToArgb(),
                    FontSize      = 10,
                    PrintSide     = 0
                };

                var printDetail = printer.PrinterDetailFactory().Populate(new ProductField[] { nameOnCardField });

                printer.Print("123456789", printDetail);
            }
        }
        public void ZebraZC3_ReadandPrint()
        {
            //Zebra.Sdk.Comm.ConnectionException
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();

                ProductField nameOnCardField = new ProductField
                {
                    Deleted       = false,
                    Printable     = true,
                    X             = 500,
                    Y             = 200,
                    Value         = Encoding.UTF8.GetBytes("Veneka Test Printing"),
                    Font          = "Consolas",
                    FontColourRGB = Color.Black.ToArgb(),
                    FontSize      = 10,
                    PrintSide     = 0
                };

                var printDetail = printer.PrinterDetailFactory().Populate(new ProductField[] { nameOnCardField });


                printer.ReadAndPrint("", printDetail, out IDeviceMagData magData);
            }
        }
        public void ZebraZC3_GetMediaInfo()
        {
            //Zebra.Sdk.Comm.ConnectionException
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();

                printer.GetMediaInfo();
            }
        }
        public void ZebraZC3_CheckPrinterStatus()
        {
            //Zebra.Sdk.Comm.ConnectionException
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();

                //printer.CheckPrinterStatus();
            }
        }
        public void ZebraZC3_DisplayJobSettings()
        {
            //Zebra.Sdk.Comm.ConnectionException
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();

                printer.DisplayJobSettings();
            }
        }
        public void ZebraZC3_HasMagEncoder()
        {
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                if (printer.Connect() == 0)
                {
                    var hasMagEncoder = printer.HasMagEncoder();
                }
            }
        }
        public void ZebraZC3_Connect()
        {
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();
            }


            //Assert.Fail();
        }
        public void ZebraZC3_GetMagData()
        {
            //Zebra.Sdk.Comm.ConnectionException
            var printers = ZebraZC3.GetPrinterList();

            using (var printer = printers[0])
            {
                printer.Connect();

                if (printer.HasMagEncoder())
                {
                    var magData = printer.ReadMagStripe();
                }
            }
        }
Exemplo n.º 9
0
        public void ZebraZC3_GetPrinterList_ReturnsEmptyDeviceList()
        {
            using (ShimsContext.Create())
            {
                // Arrange
                ZebraSdk.Printer.Discovery.Fakes.ShimUsbDiscoverer.GetZebraUsbPrintersDiscoveredPrinterFilter = (filter) =>
                {
                    return(new List <ZebraSdk.Printer.Discovery.DiscoveredUsbPrinter>());
                };

                // Act
                var printers = ZebraZC3.GetPrinterList();

                // Assert
                printers.Should().BeEmpty(because: "No printers connected to machine and device list returned must be empty");
            }
        }
Exemplo n.º 10
0
        public void ZebraZC3_GetPrinterList_ReturnsSinglePrinterInDeviceList()
        {
            using (ShimsContext.Create())
            {
                // Arrange
                ZebraSdk.Printer.Discovery.Fakes.ShimUsbDiscoverer.GetZebraUsbPrintersDiscoveredPrinterFilter = (filter) =>
                {
                    return(new List <ZebraSdk.Printer.Discovery.DiscoveredUsbPrinter>()
                    {
                        Substitute.For <ZebraSdk.Printer.Discovery.DiscoveredUsbPrinter>("symbolicName")
                    });
                };

                // Act
                var printers = ZebraZC3.GetPrinterList();

                // Assert
                printers.Should().HaveCount(1, because: "Single usb printer was returned from UsbDiscoverer and should have returned one device");
            }
        }
        public void ZebraZC3_GetPrinterList()
        {
            var printers = ZebraZC3.GetPrinterList();

            //Assert.Fail();
        }