Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Sistema de requisição com formato");

            Orcamento orc = new Orcamento(new System.Collections.Generic.List <Produto>()
            {
                new Produto("Maça", 5.00),
                new Produto("Banana", 2.50),
                new Produto("Kiwi", 12.00),
                new Produto("Manga", 7.00),
                new Produto("Pêra", 3.00),
                new Produto("Goiaba", 4.50),
                new Produto("LAPIS", 4.50),
                new Produto("CANETA", 4.50),
                new Produto("Televisor 50\"", 4660.50),
            });


            IKCV imp = new IKCV();

            CalculadorDeImposto cImposto = new CalculadorDeImposto();

            Console.WriteLine(cImposto.CalcularImpostos(orc, imp));


            Console.ReadKey();
        }
        public void RetornaImpostoUsadoDadoUmImpostoDeICMSComUmOrcamentoValido(decimal impostoEsperado, decimal valorOrcamento)
        {
            // Arrange
            var orcamento           = new Orcamento(valorOrcamento);
            var imposto             = new ICMS();
            var calculadorDeImposto = new CalculadorDeImposto(orcamento, imposto);

            // Act
            var impostoCalculado = calculadorDeImposto.CalculaImposto();

            // Assert
            Assert.Equal(impostoEsperado, impostoCalculado);
        }
        public void RetornaImpostoDoCMSDadoUmImpostoDeICMSComUmOrcamentoValido()
        {
            // Arrange
            var valor               = (decimal)1000.0;
            var orcamento           = new Orcamento(valor);
            var imposto             = new ICMS();
            var calculadorDeImposto = new CalculadorDeImposto(orcamento, imposto);

            // Act
            var impostoCalculado = calculadorDeImposto.CalculaImposto();

            // Assert
            var impostoEsperado = decimal.Add(decimal.Multiply(valor, (decimal)0.05), (decimal)50.0);

            Assert.Equal(impostoEsperado, impostoCalculado);
        }
Beispiel #4
0
 private void CalculaICCC()
 {
     this.calc         = new CalculadorDeImposto(this.orc, this.ICCC);
     txtValorICCC.Text = calc.CalculaImposto().ToString();
 }
Beispiel #5
0
 private void CalculaICPP()
 {
     this.calc    = new CalculadorDeImposto(this.orc, this.ICPP);
     txticpp.Text = calc.CalculaImposto().ToString();
 }
Beispiel #6
0
 private void CalculaIKCV()
 {
     this.calc    = new CalculadorDeImposto(this.orc, this.IKCV);
     txtikcv.Text = calc.CalculaImposto().ToString();
 }
Beispiel #7
0
 private void CalculaIMA()
 {
     this.calc   = new CalculadorDeImposto(this.orc, this.IMA);
     txtIMA.Text = calc.CalculaImposto().ToString();
 }
Beispiel #8
0
 private void CalculaIHIT()
 {
     this.calc    = new CalculadorDeImposto(this.orc, this.IHIT);
     txtIHIT.Text = calc.CalculaImposto().ToString();
 }