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

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

            //assert
        }
コード例 #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
        }
コード例 #3
0
        public void DeveGerarExceptionCasoFeriadosNulo()
        {
            //arrange
            var sabado  = new DateTime(2018, 03, 17);
            var diaUtil = new DiaUtil();

            //act
            diaUtil.ProximoFeriado(sabado);

            //assert
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #25
0
 public void CalcularPrimeiroVencimento(int diaUtil)
 {
     this.Primeiro_Vencimento = DiaUtil.ObtemDiaUtil(diaUtil);
 }