public void SubmitApplicationFor_ProductIsNotSupported_ThrowsInvalidOperationException()
        {
            var handler = new SelectiveInvoiceApplicationHandler(_selectiveInvoiceServiceMock.Object);
            var sellerApplicationMock  = new Mock <ISellerApplication>();
            var nonExistentProductMock = new Mock <IProduct>();

            sellerApplicationMock.SetupProperty(p => p.Product, nonExistentProductMock.Object);

            Func <int> act = () => handler.SubmitApplicationFor(sellerApplicationMock.Object);

            act.Should().Throw <InvalidOperationException>();
        }
        public void SubmitApplicationFor_SubmitSuccessful_ReturnsApplicationId()
        {
            var handler           = new SelectiveInvoiceApplicationHandler(_selectiveInvoiceServiceMock.Object);
            var sellerApplication = _sellerApplicationFaker.Generate();
            var product           = (SelectiveInvoiceDiscount)sellerApplication.Product;
            var applicationId     = AutoFaker.Generate <int>();

            _selectiveInvoiceServiceMock
            .Setup(m => m.SubmitApplicationFor(
                       sellerApplication.CompanyData.Number.ToString(),
                       product.InvoiceAmount,
                       product.AdvancePercentage))
            .Returns(applicationId);

            var result = handler.SubmitApplicationFor(sellerApplication);

            result.Should().Be(applicationId);
        }