Exemple #1
0
        public void DeveGerarExceptionCasoDiasDescansoVazio()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var diaUtil = new DiaUtil();

            //act
            diaUtil.ProximoDiaDescanso(segunda, new List <DayOfWeek>());

            //assert
        }
Exemple #2
0
        public void DeveGerarExceptionCasoFeriadosDiasDescansoVazio()
        {
            //arrange
            var sabado  = new DateTime(2018, 03, 17);
            var diaUtil = new DiaUtil();

            //act
            var ehDiaUtil = diaUtil.EhDiaUtil(sabado, new List <DateTime>(), new List <DayOfWeek>());

            //assert
        }
Exemple #3
0
        public void DeveGerarExceptionCasoFeriadosNulo()
        {
            //arrange
            var sabado  = new DateTime(2018, 03, 17);
            var diaUtil = new DiaUtil();

            //act
            diaUtil.ProximoFeriado(sabado);

            //assert
        }
Exemple #4
0
        public void NaoDeveSerDiaUtilDomingoDiaDescansoPadrao()
        {
            //arrange
            var dataParametro = new DateTime(2018, 01, 07);
            var diaUtil       = new DiaUtil();

            //act
            var naoEhDiaUtil = !diaUtil.EhDiaUtil(dataParametro, DiasUteisTestsInitializer.Feriados);

            //assert
            Assert.IsTrue(naoEhDiaUtil);
        }
Exemple #5
0
        public void NaoDeveSerDiaUtilTercaDiaDescansoDiferente()
        {
            //arrange
            var dataParametro = new DateTime(2018, 03, 27);
            var diaUtil       = new DiaUtil();

            //act
            var naoEhDiaUtil = !diaUtil.EhDiaUtil(dataParametro, DiasUteisTestsInitializer.Feriados, DiasUteisTestsInitializer.DiasDescanso);

            //assert
            Assert.IsTrue(naoEhDiaUtil);
        }
Exemple #6
0
        public void NaoDeveGerarExceptionCasoFeriadosVazio()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var diaUtil = new DiaUtil();

            //act
            var ehDiaUtil = diaUtil.EhDiaUtil(segunda, new List <DateTime>());

            //assert
            Assert.IsTrue(ehDiaUtil);
        }
Exemple #7
0
        public void DeveSerDiaUtilDiaDescansoDiferente()
        {
            //arrange
            var dataParametro = new DateTime(2018, 01, 03);
            var diaUtil       = new DiaUtil();

            //act
            var ehDiaUtil = diaUtil.EhDiaUtil(dataParametro, DiasUteisTestsInitializer.Feriados, DiasUteisTestsInitializer.DiasDescanso);

            //assert
            Assert.IsTrue(ehDiaUtil);
        }
Exemple #8
0
        public void DeveSerSegundaFeiraAPartirDeSabado()
        {
            //arrange
            var sabado  = new DateTime(2018, 03, 24);
            var diaUtil = new DiaUtil();

            //act
            var proximoDiaUtil = diaUtil.ProximoDiaUtil(sabado);
            var segunda        = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];

            //assert
            Assert.AreEqual(segunda, proximoDiaUtil);
        }
Exemple #9
0
        public void NaoDeveTerDiaUtilEntreSabadoEDomingo()
        {
            //arrange
            var sabado  = new DateTime(2018, 03, 17);
            var domingo = new DateTime(2018, 03, 18);
            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(sabado, domingo);

            //assert
            Assert.AreEqual(0, numDiasUteis);
        }
Exemple #10
0
        public void DeveSerTiradentesAPartirDeMarco()
        {
            //arrange
            var marco      = new DateTime(2018, 03, 02);
            var tiradentes = DiasUteisTestsInitializer.Tiradentes;
            var diaUtil    = new DiaUtil();

            //act
            var proximoFeriado = diaUtil.ProximoFeriado(marco, DiasUteisTestsInitializer.Feriados);

            //assert
            Assert.AreEqual(tiradentes, proximoFeriado);
        }
Exemple #11
0
        public void DeveSerSabadoAPartirDeTerca()
        {
            //arrange
            var terca   = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];
            var sabado  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Saturday];
            var diaUtil = new DiaUtil();

            //act
            var proximoDiaDescanso = diaUtil.ProximoDiaDescanso(terca);

            //assert
            Assert.AreEqual(sabado, proximoDiaDescanso);
        }
Exemple #12
0
        public void DeveSerSabadoAPartirDeSegunda()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var sabado  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Saturday];
            var diaUtil = new DiaUtil();

            //act
            var proximaFolga = diaUtil.ProximaFolga(segunda);

            //assert
            Assert.AreEqual(sabado, proximaFolga);
        }
Exemple #13
0
        public void DeveSerConfraternizacaoUniversalApartirDeDezembro()
        {
            //arrange
            var dezembro = new DateTime(2017, 12, 02);
            var confraternizacaoUniversal = DiasUteisTestsInitializer.ConfraternizacaoUniversal;
            var diaUtil = new DiaUtil();

            //act
            var proximoFeriado = diaUtil.ProximoFeriado(dezembro, DiasUteisTestsInitializer.Feriados);

            //assert
            Assert.AreEqual(confraternizacaoUniversal, proximoFeriado);
        }
Exemple #14
0
        public void DeveTer1DiaUtilEntreDomingoETerca()
        {
            //arrange
            var domingo = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Sunday];
            var terca   = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];

            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(domingo, terca);

            //assert
            Assert.AreEqual(1, numDiasUteis);
        }
Exemple #15
0
        public void DeveTer3DiasUteisEntreDomingoEQuintaFeira()
        {
            //arrange
            var domingo = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Sunday];
            var quinta  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Thursday];

            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(domingo, quinta);

            //assert
            Assert.AreEqual(3, numDiasUteis);
        }
Exemple #16
0
        public void DeveSerSegundaFeiraAPartirDeDomingo()
        {
            //arrange
            var domingo = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Sunday];
            var diaUtil = new DiaUtil();

            //act
            var proximoDiaUtil = diaUtil.ProximoDiaUtil(domingo);
            var segunda        = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];


            //assert
            Assert.AreEqual(segunda, proximoDiaUtil);
        }
Exemple #17
0
        public void DeveSerTercaFeiraAPartirDeSegunda()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var diaUtil = new DiaUtil();

            //act
            var proximoDiaUtil = diaUtil.ProximoDiaUtil(segunda);
            var terca          = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];


            //assert
            Assert.AreEqual(terca, proximoDiaUtil);
        }
Exemple #18
0
        public void DeveTer0DiaUtilEntreSegundaETerca()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var terca   = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];

            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(segunda, terca);

            //assert
            Assert.AreEqual(0, numDiasUteis);
        }
Exemple #19
0
        public void DeveTer1DiaUtilEntreSabadoETerca()
        {
            //arrange
            var sabado = new DateTime(2018, 03, 24);
            var terca  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];

            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(sabado, terca);

            //assert
            Assert.AreEqual(1, numDiasUteis);
        }
Exemple #20
0
        public void DeveTer10DiasUteisEntreDatas()
        {
            //arrange
            var dataInicio = new DateTime(2018, 03, 01);
            var dataFim    = new DateTime(2018, 03, 16);

            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(dataInicio, dataFim);

            //assert
            Assert.AreEqual(10, numDiasUteis);
        }
Exemple #21
0
        public void DeveTer0DiaUtilEntreTercaEQuarta()
        {
            //arrange
            var terca  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];
            var quarta = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Wednesday];

            var diaUtil = new DiaUtil();

            //act
            var numDiasUteis = diaUtil.DiasUteisEntreDatas(terca, quarta);

            //assert
            Assert.AreEqual(0, numDiasUteis);
        }
Exemple #22
0
        public void DeveSerQuartaAPartirDeSegundaSeQuartaForFeriado()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var quarta  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Wednesday];
            var diaUtil = new DiaUtil();

            //act
            var proximaFolga = diaUtil.ProximaFolga(segunda, new List <DateTime> {
                quarta
            });

            //assert
            Assert.AreEqual(quarta, proximaFolga);
        }
Exemple #23
0
        public void DeveSerQuartaAPartirDeSegundaSeQuartaForDiaDeDescanso()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var quarta  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Wednesday];
            var diaUtil = new DiaUtil();

            //act
            var proximoDiaDescanso = diaUtil.ProximoDiaDescanso(segunda, new List <DayOfWeek> {
                DayOfWeek.Wednesday
            });

            //assert
            Assert.AreEqual(quarta, proximoDiaDescanso);
        }
Exemple #24
0
        public void DeveSerQuintaFeiraAPartirDeSegundaSeTercaEQuartaForemFeriados()
        {
            //arrange
            var segunda = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Monday];
            var terca   = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Tuesday];
            var quarta  = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Wednesday];
            var diaUtil = new DiaUtil();

            //act
            var proximoDiaUtil = diaUtil.ProximoDiaUtil(segunda, new List <DateTime> {
                terca, quarta
            });
            var quinta = DiasUteisTestsInitializer.DiasParaTestes[DayOfWeek.Thursday];

            //assert
            Assert.AreEqual(quinta, proximoDiaUtil);
        }
 public void CalcularPrimeiroVencimento(int diaUtil)
 {
     this.Primeiro_Vencimento = DiaUtil.ObtemDiaUtil(diaUtil);
 }