コード例 #1
0
        public void Sould_Return_Zero_If_Supplier_Is_Not_VAT_Payer()
        {
            var expectedResult = 0;

            _supplier.IsVatPayer.Returns(false);

            var result = _invoiceGenerator.GenerateInvoiceVAT(_supplier, _customer);

            Assert.AreEqual(result, expectedResult);
        }
コード例 #2
0
        public void Sould_Return_Country_VAT_If_Supplier_And_Cutomer_In_The_Same_Country()
        {
            var expectedResult = 21;

            _customer.Country.Returns("Lithuania");
            _eUCountryChecker.IsEUCoutry(_customer.Country).Returns(true);
            _eUCountryChecker.GetEUCoutryAlpha2Code(_customer.Country).Returns("lt");
            _vATReuester.GetEUCountryVAT(_eUCountryChecker.GetEUCoutryAlpha2Code(_customer.Country)).Returns(21);
            _invoiceGenerator = new InvoiceGenerator(_vATReuester, _eUCountryChecker);

            var result = _invoiceGenerator.GenerateInvoiceVAT(_supplier, _customer);

            Assert.AreEqual(result, expectedResult);
        }
コード例 #3
0
        public void Sould_Return_Countiry_VAT_If_Supplier_Is_VAT_Payer_And_Customer_Not_VAT_Payer_And_Customer_Not_In_EU_Region_And_Supplier_In_Different_Country()
        {
            var expectedResult = 21;

            _customer.IsVatPayer.Returns(false);
            _eUCountryChecker.IsEUCoutry(_customer.Country).Returns(true);
            _eUCountryChecker.GetEUCoutryAlpha2Code(_customer.Country).Returns("lt");
            _vATReuester.GetEUCountryVAT(_eUCountryChecker.GetEUCoutryAlpha2Code(_customer.Country)).Returns(21);
            _invoiceGenerator = new InvoiceGenerator(_vATReuester, _eUCountryChecker);

            var result = _invoiceGenerator.GenerateInvoiceVAT(_supplier, _customer);

            Assert.AreEqual(result, expectedResult);
        }