Example #1
0
 public async Task ShouldPostTaxYearlyThrowsTaxesManagerException()
 {
     var service = new TaxCommand(_context);
     await Assert.ThrowsAsync <TaxesManagerException>(() =>
                                                      service.PostTaxYearly(new TaxDto {
         Municipality = "Vilnius", TaxAmount = 8
     }));
 }
Example #2
0
        public async Task ShouldPostTaxYearly()
        {
            var service = new TaxCommand(_context);
            var result  = await service.PostTaxYearly(new TaxDto { Municipality = "Vilnius", TaxAmount = 0.15 });

            Assert.Equal("Vilnius", result.Municipality);
            Assert.Equal(0.15, result.TaxAmount);
            Assert.Equal(Frequency.Yearly, result.Frequency);
        }
Example #3
0
        public async Task ShouldUpdateTax()
        {
            var service = new TaxCommand(_context);
            var tax1    = await service.PostTaxYearly(new TaxDto { Municipality = "Vilnius", TaxAmount = 0.1 });

            var tax2 = await service.PutTax("Vilnius", DateTime.Parse("2020-01-01"), DateTime.Parse("2020-12-31"), 0.2);

            var tax3 = await service.GetTax("Vilnius", DateTime.Parse("2020-01-01"), DateTime.Parse("2020-12-31"));

            Assert.Equal(0.2, tax3.TaxAmount);
        }
Example #4
0
        public async Task ShouldGetTaxAmountDaily()
        {
            var service = new TaxCommand(_context);
            var tax1    = await service.PostTaxYearly(new TaxDto { Municipality = "Vilnius", TaxAmount = 0.1 });

            var tax2 = await service.PostTaxMonthly(new TaxDto { Municipality = "Vilnius", TaxAmount = 0.3, Month = 9 });

            var tax3 = await service.PostTaxDaily(new TaxDto { Municipality = "Vilnius", TaxAmount = 0.5, Month = 9, Day = 14 });

            var tax = await service.GetTaxAmount("Vilnius", "2020-09-14");

            Assert.Equal(0.5, tax.TaxAmount);
        }