public void ProcessShippingAndCommissionSlipWhenSlipGeneratorReturnedTrue() { _mockPaymentSlipGenerator.Setup(m => m.GenerateComissionSlip()).Returns(true); _mockPaymentSlipGenerator.Setup(m => m.GenerateShippingSlip()).Returns(true); _physicalProductProcessor.Process(); _mockPaymentSlipGenerator.Verify(m => m.GenerateComissionSlip(), Times.Once); _mockPaymentSlipGenerator.Verify(m => m.GenerateShippingSlip(), Times.Once); }
public void Handle(int productId) { try { var productType = _productTypeCollection.GetProductType(productId); switch (productType) { case "PhysicalProduct": _physicalProductProcessor.Process(); break; case "Book": _bookProcessor.Process(); break; case "ActivateMembership": _membershipProcessor.ActivateMembership(); break; case "UpgradeMembership": _membershipProcessor.UpgradeMembership(); break; case "Video": Console.WriteLine("Option not implemented"); break; default: break; } } catch (Exception e) { Console.WriteLine(e.Message); throw; } }