public void ProductApplicationService_SubmitApplicationFor_WhenCalledWithSelectiveInvoiceDiscount_OnError_ShouldReturnMinusOne() { _sellerApplication = TestSellerApplicationProvider.GetTestSellerApplication(new SelectiveInvoiceDiscount()); _selectInvoiceServiceMock.Setup(m => m.SubmitApplicationFor(It.IsAny <string>(), It.IsAny <decimal>(), It.IsAny <decimal>())).Returns(-1); var result = _sut.SubmitApplicationFor(_sellerApplication); result.Should().Be(-1); }
public void ProductApplicationService_SubmitApplicationFor_WhenCalledWithBusinessLoans_OnError_ShouldReturnMinusOne() { InitResult(success: false); _sellerApplication = TestSellerApplicationProvider.GetTestSellerApplication(new BusinessLoans()); _businessLoansServiceMock.Setup(m => m.SubmitApplicationFor(It.IsAny <CompanyDataRequest>(), It.IsAny <LoansRequest>())).Returns(_result.Object); var result = _sut.SubmitApplicationFor(_sellerApplication); result.Should().Be(-1); }
public void ProductApplicationService_SubmitApplicationFor_WhenCalledWithConfidentialInvoiceDiscount_OnError_ShouldReturnMinusOne() { InitResult(success: false); _sellerApplication = TestSellerApplicationProvider.GetTestSellerApplication(new ConfidentialInvoiceDiscount()); _confidentialInvoiceServiceMock.Setup(m => m.SubmitApplicationFor(It.IsAny <CompanyDataRequest>(), It.IsAny <decimal>(), It.IsAny <decimal>(), It.IsAny <decimal>())).Returns(_result.Object); var result = _sut.SubmitApplicationFor(_sellerApplication); result.Should().Be(-1); }
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}"); }