public void LogsAsError_WhenOrderNotSet() { this.testee.CreateOrder(null); A.CallTo(() => this.logger.Error(OrderCreatorLogExtensionMethods.FormatOrderNotSet())) .MustHaveHappened(); }
public void LogsAsError_WhenCustomerAddressNotSet() { var orderWithoutCustomerAddress = new OrderRequest(1, "Dagobert Duck", null, new Collection <OrderItem>()); this.testee.CreateOrder(orderWithoutCustomerAddress); A.CallTo(() => this.logger.Error(OrderCreatorLogExtensionMethods.FormatCustomerAddressNotSet(orderWithoutCustomerAddress))) .MustHaveHappened(); }
public void LogsAsInfo_WhenProcessingOrder() { var sampleOrder = new OrderRequest(1, "Donald Duck", "Duckburg", new Collection <OrderItem>()); this.testee.CreateOrder(sampleOrder); A.CallTo(() => this.logger.Info(OrderCreatorLogExtensionMethods.FormatProcessingOrder(sampleOrder))) .MustHaveHappened(); }
public void LogsAsWarning_WhenOrderExceedsAmountLimit() { const int Limit = 150; const decimal AmountFirstItem = 20; const decimal AmountSecondItem = 300; const decimal Amount = AmountFirstItem + AmountSecondItem; OrderItem[] orderItems = { new OrderItem(12, "Pucks", AmountFirstItem), new OrderItem(13, "Skates", AmountSecondItem) }; var orderExceedingAmountLimit = new OrderRequest(1, "Mighty Ducks", "Anaheim", orderItems); this.testee.CreateOrder(orderExceedingAmountLimit); A.CallTo(() => this.logger.Warn( OrderCreatorLogExtensionMethods.FormatOrderExceedsLimit(orderExceedingAmountLimit, Amount, Limit))).MustHaveHappened(); }