public void BusinessLoansStrategy_SubmitWrongProduct_ShouldThrowError() { _strategy = new BusinessLoansStrategy(_businessLoansServiceMock.Object); _sellerApplication = TestSellerApplicationProvider.GetTestSellerApplication(new ConfidentialInvoiceDiscount()); Action submit = () => _strategy.Submit(_sellerApplication); submit.Should().Throw <InvalidOperationException>(because: $"The {typeof(ConfidentialInvoiceDiscount).Name} " + $"is not acceptable for {typeof(BusinessLoansStrategy).Name}. " + $"Expected type: {typeof(BusinessLoans).Name}"); }
public void RegisterStrategy <T>(ProductApplicationStrategyAbstract strategy) => _strategies.Add(typeof(T), strategy);