public void GetStatusTest_OffLineStatus() { // Tests may run in parallel and since we are using a serial port // we should just run all queries in one test to avoid access issues. var printer = new PhoenixPrinter(TEST_PORT); var status = printer.GetStatus(StatusTypes.OfflineStatus); Assert.IsNotNull(status); // Only these should be set Assert.IsNotNull(status.HasError); // All the rest must be null Assert.IsNull(status.IsCoverClosed); Assert.IsNull(status.IsNormalFeed); Assert.IsNull(status.IsPaperPresent); Assert.IsNull(status.IsOnline); Assert.IsNull(status.IsPaperLevelOkay); Assert.IsNull(status.IsTicketPresentAtOutput); Assert.IsNull(status.IsPaperMotorOff); Assert.IsNull(status.IsDiagButtonReleased); Assert.IsNull(status.IsHeadTemperatureOkay); Assert.IsNull(status.IsCommsOkay); Assert.IsNull(status.IsPowerSupplyVoltageOkay); Assert.IsNull(status.IsPaperPathClear); Assert.IsNull(status.IsCutterOkay); Assert.IsNull(status.HasFatalError); Assert.IsNull(status.HasRecoverableError); }
public void Print2DBarcodeTest() { var printer = new PhoenixPrinter(TEST_PORT); var status = printer.GetStatus(StatusTypes.PaperStatus); printer.Print2DBarcode("Hello World"); }
public void GetStatusTest_ErrorStatus() { // Tests may run in parallel and since we are using a serial port // we should just run all queries in one test to avoid access issues. var printer = new PhoenixPrinter(TEST_PORT); // TODO base ESC/POS firmware does not support this return; var status = printer.GetStatus(StatusTypes.ErrorStatus); // If this fails, we have a hardware or configuration issue Assert.IsFalse(status.IsInvalidReport); Assert.IsNotNull(status); // Only these should be set Assert.IsNotNull(status.IsCutterOkay); Assert.IsNotNull(status.HasFatalError); Assert.IsNotNull(status.HasRecoverableError); // All the rest must be null Assert.IsNull(status.IsOnline); Assert.IsNull(status.IsPaperPresent); Assert.IsNull(status.IsPaperLevelOkay); Assert.IsNull(status.IsTicketPresentAtOutput); Assert.IsNull(status.IsCoverClosed); Assert.IsNull(status.IsPaperMotorOff); Assert.IsNull(status.IsDiagButtonReleased); Assert.IsNull(status.IsHeadTemperatureOkay); Assert.IsNull(status.IsCommsOkay); Assert.IsNull(status.IsPowerSupplyVoltageOkay); Assert.IsNull(status.IsPaperPathClear); Assert.IsNull(status.IsNormalFeed); Assert.IsNull(status.HasError); }
public void PHX_RealHardwareTests() { var printer = new PhoenixPrinter(TEST_PORT); Assert.IsNotNull(printer); printer.Reinitialize(); printer.PrintASCIIString("No effects - Left"); printer.PrintNewline(); printer.AddEffect(FontEffects.Bold); printer.PrintASCIIString("This is bold"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Bold); printer.AddEffect(FontEffects.Italic); printer.PrintASCIIString("This is italic"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Italic); printer.AddEffect(FontEffects.Underline); printer.PrintASCIIString("This is underline"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Underline); printer.AddEffect(FontEffects.Rotated); printer.PrintASCIIString("This is rotated"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Rotated); printer.AddEffect(FontEffects.Reversed); printer.PrintASCIIString("This is reversed"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Reversed); printer.AddEffect(FontEffects.UpsideDown); printer.PrintASCIIString("This is upsideDown"); printer.PrintNewline(); printer.Reinitialize(); printer.SetJustification(FontJustification.JustifyCenter); printer.PrintASCIIString("No effects - Center"); printer.PrintNewline(); printer.AddEffect(FontEffects.Bold); printer.PrintASCIIString("This is bold"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Bold); printer.AddEffect(FontEffects.Italic); printer.PrintASCIIString("This is italic"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Italic); printer.AddEffect(FontEffects.Underline); printer.PrintASCIIString("This is underline"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Underline); printer.AddEffect(FontEffects.Rotated); printer.PrintASCIIString("This is rotated"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Rotated); printer.AddEffect(FontEffects.Reversed); printer.PrintASCIIString("This is reversed"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Reversed); printer.AddEffect(FontEffects.UpsideDown); printer.PrintASCIIString("This is upsideDown"); printer.PrintNewline(); printer.Reinitialize(); printer.SetJustification(FontJustification.JustifyRight); printer.PrintASCIIString("No effects - Right"); printer.PrintNewline(); printer.AddEffect(FontEffects.Bold); printer.PrintASCIIString("This is bold"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Bold); printer.AddEffect(FontEffects.Italic); printer.PrintASCIIString("This is italic"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Italic); printer.AddEffect(FontEffects.Underline); printer.PrintASCIIString("This is underline"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Underline); printer.AddEffect(FontEffects.Rotated); printer.PrintASCIIString("This is rotated"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Rotated); printer.AddEffect(FontEffects.Reversed); printer.PrintASCIIString("This is reversed"); printer.PrintNewline(); printer.RemoveEffect(FontEffects.Reversed); printer.AddEffect(FontEffects.UpsideDown); printer.PrintASCIIString("This is upsideDown"); printer.PrintNewline(); printer.FormFeed(); }
public void PhoenixCtorTest() { var printer = new PhoenixPrinter("TEST"); Assert.IsNotNull(printer); }