Exemplo n.º 1
0
        public void ShouldReturnZeroWhenProviderIsNotVatPayer()
        {
            var customer = new Customer()
            {
                Id         = 1,
                Name       = "Maxima",
                IsCompany  = true,
                IsVatPayer = true,
                Country    = new Country
                {
                    Id   = 1,
                    Name = "Lithuania",
                    CountryInformation = new CountryInformation
                    {
                        IsEuMember = true,
                        Vat        = 21,
                    }
                }
            };

            var provider = new Provider
            {
                Id         = 2,
                Name       = "Lidl",
                IsVatPayer = false,
                Country    = new Country
                {
                    Id   = 1,
                    Name = "Lithuania",
                    CountryInformation = new CountryInformation
                    {
                        IsEuMember = true,
                        Vat        = 21,
                    }
                }
            };
            var amount = 1000;

            _dataService.GetCustomerById(customer.Id).Returns(customer);
            _dataService.GetProviderById(provider.Id).Returns(provider);

            var result = _calculatorService.CalculateVat(customer.Id, provider.Id, amount);

            result.ShouldBe(0);
        }