public void IngenicoPinpadPrinter_AddSeparator_ShouldMatchFontSize_IfMethodIsMappingItCorrectly() { // Arrange PrinterFontSize expectedFontSize = PrinterFontSize.Big; // Act this.Printer.AddSeparator(); // Assert Assert.AreEqual(expectedFontSize, this.Printer.ItemsToPrint[0].FontSize); }
public void IngenicoPinpadPrinter_AppendLine_ShouldMatchFontSize_IfParametersArePassedAndMethodIsMappingItCorrectly() { // Arrange string text = "I'm a happy text!"; PrinterAlignmentCode alignment = PrinterAlignmentCode.Center; PrinterFontSize expectedSize = PrinterFontSize.Medium; // Act this.Printer.AppendLine(alignment, expectedSize, text); // Assert Assert.AreEqual(expectedSize, this.Printer.ItemsToPrint[0].FontSize); }
public void IngenicoPinpadPrinter_AddQrCode_ShouldMatchQrCodeSize_IfMethodIsMappingItCorrectly() { // Arrange string qrCodeMessage = "I'm a QR code!"; PrinterAlignmentCode alignment = PrinterAlignmentCode.Center; PrinterFontSize expectedQrCodeSize = PrinterFontSize.Big; // Act this.Printer.AddQrCode(alignment, qrCodeMessage); // Assert Assert.AreEqual(expectedQrCodeSize, this.Printer.ItemsToPrint[0].FontSize); }
public void IngenicoPinpadPrinter_AppendLine_ShouldOneTextItemToPrinterBuffer_IfParametersArePassed() { // Arrange PrinterAlignmentCode alignment = PrinterAlignmentCode.Left; PrinterFontSize size = PrinterFontSize.Medium; string messageToPrint = "I'm a happy text!"; int expectedItemsToPrint = 1; // Act this.Printer.AppendLine(alignment, size, messageToPrint); // Assert Assert.AreEqual(expectedItemsToPrint, this.Printer.ItemsToPrint.Count); }
public void IngenicoPinpadPrinter_AppendLine_ShouldReturnItself_IfMethodIsCorrectAndParametersArePassed() { // Arrange PrinterAlignmentCode alignment = PrinterAlignmentCode.Left; PrinterFontSize size = PrinterFontSize.Medium; string messageToPrint = "I'm a happy text!"; // Act IPinpadPrinter returnedPrinter = this.Printer.AppendLine(alignment, size, messageToPrint); // Assert Assert.AreEqual(returnedPrinter, this.Printer); }
public void IngenicoPinpadPrinter_AppendLine_ShouNotReturnNull_IfParametersArePassed() { // Arrange PrinterAlignmentCode alignment = PrinterAlignmentCode.Left; PrinterFontSize size = PrinterFontSize.Medium; string messageToPrint = "I'm a happy text!"; // Act IPinpadPrinter returnedPrinter = this.Printer.AppendLine(alignment, size, messageToPrint); // Assert Assert.IsNotNull(returnedPrinter); }
/// <summary> /// Add line of text to the printer buffer. /// </summary> /// <param name="alignment">Text alignment.</param> /// <param name="fontSize">Font size.</param> /// <param name="text">Text to print.</param> /// <param name="args">Arguments to the text to print.</param> /// <returns>Itself.</returns> public IPinpadPrinter AppendLine(PrinterAlignmentCode alignment, PrinterFontSize fontSize, string text, params object[] args) { PrinterItem newLine = new PrinterItem { Type = IngenicoPrinterAction.PrintText, Text = this.GetNormalizedText(string.Format(text, args)), Alignment = alignment, FontSize = fontSize }; this.ItemsToPrint.Add(newLine); return(this); }