public static string Print(OrderLine orderLine) { return string.Format("{0}{1}{2}", orderLine.GetDescription(OrderLineDescriber), PrinterConst.COLON, orderLine.AfterTaxAmount().ToString(PrinterConst.DECIMAL_FORMAT)); }
public void Can_Calculate_PreTaxAmount() { Product stubProduct = ProductStubifier.CreateStubProduct(11.50m); _orderLineSut = new OrderLine(stubProduct) {Quantity = 10}; decimal preTaxAmount = _orderLineSut.PreTaxAmount(); Assert.AreEqual(115.0m, preTaxAmount); }
private void CreateSut(bool withMockService) { _orderLineSut = new OrderLine(ProductStubifier.CreateStubProduct()); if (!withMockService) return; _mockTaxService = new Mock<ITaxService>(); _orderLineSut.TaxService = _mockTaxService.Object; }
public string Describe(OrderLine orderLine) { var sb = new StringBuilder(); OutputQuantity(sb, orderLine); OutputSaleUnit(sb, orderLine.Product); OutputImportedInfo(sb, orderLine); OutputPurchaseUnit(sb, orderLine.Product); OutputProductName(sb, orderLine); return sb.ToString(); }
private static void OutputQuantity(StringBuilder sb, OrderLine orderLine) { sb.Append(orderLine.Quantity).Append(Space); }
private static void OutputProductName(StringBuilder sb, OrderLine orderLine) { sb.Append(orderLine.Product.Name); }
private static void OutputImportedInfo(StringBuilder sb, OrderLine orderLine) { if (orderLine.IsImported) sb.Append(PrinterConst.IMPORTED).Append(Space); }