Esempio n. 1
0
 public void Años()
 {
     #region Años
     var retorno = JiraTiempos.Evaluar($"{2 }a");
     Assert.AreEqual("2a", retorno);
     #endregion
 }
Esempio n. 2
0
        public void Horas()
        {
            #region Horas
            var retorno = JiraTiempos.Evaluar($"{1  }h");
            Assert.AreEqual("1h", retorno);
            #endregion
            #region Dias
            retorno = JiraTiempos.Evaluar($"{1 * 8}h");
            Assert.AreEqual("1d", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 8 + 7 }h");
            Assert.AreEqual("1d 7h", retorno);
            #endregion
            #region Semanas
            retorno = JiraTiempos.Evaluar($"{2 * 8 * 5  }h");
            Assert.AreEqual("2w", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 8 * 5 + 4 * 8  }h");
            Assert.AreEqual("1w 4d", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 8 * 5 + 4 * 8 + 7}h");
            Assert.AreEqual("1w 4d 7h", retorno);
            #endregion
            #region Mes
            retorno = JiraTiempos.Evaluar($"{3  * 8 * 5 * 4}h");
            Assert.AreEqual("3M", retorno);

            retorno = JiraTiempos.Evaluar($"{3  * 8 * 5 * 4 + 2 * 8 * 5  }h");
            Assert.AreEqual("3M 2w", retorno);

            retorno = JiraTiempos.Evaluar($"{3 * 8 * 5 * 4 + 1  * 8 * 5 + 4  * 8  }h");
            Assert.AreEqual("3M 1w 4d", retorno);

            retorno = JiraTiempos.Evaluar($"{3  * 8 * 5 * 4 + 1  * 8 * 5 + 4 * 8 + 7 }h");
            Assert.AreEqual("3M 1w 4d 7h", retorno);
            #endregion
            #region Años
            retorno = JiraTiempos.Evaluar($"{2  * 8 * 5 * 4 * 12}h");
            Assert.AreEqual("2a", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 8 * 5 * 4 * 12 + 3  * 8 * 5 * 4}h");
            Assert.AreEqual("2a 3M", retorno);

            retorno = JiraTiempos.Evaluar($"{2 * 8 * 5 * 4 * 12 + 3  * 8 * 5 * 4 + 2  * 8 * 5  }h");
            Assert.AreEqual("2a 3M 2w", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 8 * 5 * 4 * 12 + 3  * 8 * 5 * 4 + 1  * 8 * 5 + 4 * 8  }h");
            Assert.AreEqual("2a 3M 1w 4d", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 8 * 5 * 4 * 12 + 3  * 8 * 5 * 4 + 1  * 8 * 5 + 4 * 8 + 7  }h");
            Assert.AreEqual("2a 3M 1w 4d 7h", retorno);
            #endregion
        }
Esempio n. 3
0
        public void Meses()
        {
            #region Meses
            var retorno = JiraTiempos.Evaluar($"{2}M");
            Assert.AreEqual("2M", retorno);
            #endregion
            #region Años
            retorno = JiraTiempos.Evaluar($"{2  * 12}M");
            Assert.AreEqual("2a", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 12 + 3 }M");
            Assert.AreEqual("2a 3M", retorno);
            #endregion
        }
Esempio n. 4
0
        public void Dias()
        {
            #region Dias
            var retorno = JiraTiempos.Evaluar($"{1 }d");
            Assert.AreEqual("1d", retorno);
            #endregion
            #region Semanas
            retorno = JiraTiempos.Evaluar($"{2 * 5  }d");
            Assert.AreEqual("2w", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 5 + 4   }d");
            Assert.AreEqual("1w 4d", retorno);
            #endregion
            #region Mes
            retorno = JiraTiempos.Evaluar($"{3  * 5 * 4}d");
            Assert.AreEqual("3M", retorno);

            retorno = JiraTiempos.Evaluar($"{3  * 5 * 4 + 2 * 5  }d");
            Assert.AreEqual("3M 2w", retorno);

            retorno = JiraTiempos.Evaluar($"{3  * 5 * 4 + 1  * 5 + 4   }d");
            Assert.AreEqual("3M 1w 4d", retorno);
            #endregion
            #region Años
            retorno = JiraTiempos.Evaluar($"{2 * 5 * 4 * 12}d");
            Assert.AreEqual("2a", retorno);

            retorno = JiraTiempos.Evaluar($"{2 * 5 * 4 * 12 + 3  * 5 * 4}d");
            Assert.AreEqual("2a 3M", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 5 * 4 * 12 + 3  * 5 * 4 + 2  * 5  }d");
            Assert.AreEqual("2a 3M 2w", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 5 * 4 * 12 + 3  * 5 * 4 + 1 * 5 + 4   }d");
            Assert.AreEqual("2a 3M 1w 4d", retorno);
            #endregion
        }
Esempio n. 5
0
        public void Semanas()
        {
            #region Semanas
            var retorno = JiraTiempos.Evaluar($"{2}w");
            Assert.AreEqual("2w", retorno);
            #endregion
            #region Mes
            retorno = JiraTiempos.Evaluar($"{3  * 4}w");
            Assert.AreEqual("3M", retorno);

            retorno = JiraTiempos.Evaluar($"{3 * 4 + 2   }w");
            Assert.AreEqual("3M 2w", retorno);
            #endregion
            #region Años
            retorno = JiraTiempos.Evaluar($"{2  * 4 * 12}w");
            Assert.AreEqual("2a", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 4 * 12 + 3 * 4}w");
            Assert.AreEqual("2a 3M", retorno);

            retorno = JiraTiempos.Evaluar($"{2 * 4 * 12 + 3 * 4 + 2   }w");
            Assert.AreEqual("2a 3M 2w", retorno);
            #endregion
        }
Esempio n. 6
0
        public void Segundos()
        {
            #region Segundos
            var retorno = JiraTiempos.Evaluar(1);
            Assert.AreEqual("1s", retorno);
            #endregion
            #region Minutos
            retorno = JiraTiempos.Evaluar(1 * 60);
            Assert.AreEqual("1m", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 + 30);
            Assert.AreEqual("1m 30s", retorno);
            #endregion
            #region Horas
            retorno = JiraTiempos.Evaluar(1 * 60 * 60);
            Assert.AreEqual("1h", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 + 30 * 60);
            Assert.AreEqual("1h 30m", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 + 30 * 60 + 30);
            Assert.AreEqual("1h 30m 30s", retorno);
            #endregion
            #region Dias
            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8);
            Assert.AreEqual("1d", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 + 7 * 60 * 60);
            Assert.AreEqual("1d 7h", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60);
            Assert.AreEqual("1d 7h 30m", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60 + 30);
            Assert.AreEqual("1d 7h 30m 30s", retorno);
            #endregion
            #region Semanas
            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5);
            Assert.AreEqual("2w", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8);
            Assert.AreEqual("1w 4d", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60);
            Assert.AreEqual("1w 4d 7h", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60);
            Assert.AreEqual("1w 4d 7h 30m", retorno);

            retorno = JiraTiempos.Evaluar(1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60 + 30);
            Assert.AreEqual("1w 4d 7h 30m 30s", retorno);
            #endregion
            #region Mes
            retorno = JiraTiempos.Evaluar(3 * 60 * 60 * 8 * 5 * 4);
            Assert.AreEqual("3M", retorno);

            retorno = JiraTiempos.Evaluar(3 * 60 * 60 * 8 * 5 * 4 + 2 * 60 * 60 * 8 * 5);
            Assert.AreEqual("3M 2w", retorno);

            retorno = JiraTiempos.Evaluar(3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8);
            Assert.AreEqual("3M 1w 4d", retorno);

            retorno = JiraTiempos.Evaluar(3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60);
            Assert.AreEqual("3M 1w 4d 7h", retorno);

            retorno = JiraTiempos.Evaluar(3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60);
            Assert.AreEqual("3M 1w 4d 7h 30m", retorno);

            retorno = JiraTiempos.Evaluar(3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60 + 30);
            Assert.AreEqual("3M 1w 4d 7h 30m 30s", retorno);
            #endregion
            #region Años
            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12);
            Assert.AreEqual("2a", retorno);

            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 60 * 8 * 5 * 4);
            Assert.AreEqual("2a 3M", retorno);

            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 60 * 8 * 5 * 4 + 2 * 60 * 60 * 8 * 5);
            Assert.AreEqual("2a 3M 2w", retorno);

            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8);
            Assert.AreEqual("2a 3M 1w 4d", retorno);

            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60);
            Assert.AreEqual("2a 3M 1w 4d 7h", retorno);

            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60);
            Assert.AreEqual("2a 3M 1w 4d 7h 30m", retorno);

            retorno = JiraTiempos.Evaluar(2 * 60 * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 60 * 8 * 5 * 4 + 1 * 60 * 60 * 8 * 5 + 4 * 60 * 60 * 8 + 7 * 60 * 60 + 30 * 60 + 30);
            Assert.AreEqual("2a 3M 1w 4d 7h 30m 30s", retorno);
            #endregion
        }
Esempio n. 7
0
        public void Minutos()
        {
            #region Minutos
            var retorno = JiraTiempos.Evaluar($"{1 }m");
            Assert.AreEqual("1m", retorno);
            #endregion
            #region Horas
            retorno = JiraTiempos.Evaluar($"{1 * 60 }m");
            Assert.AreEqual("1h", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 60 + 30}m");
            Assert.AreEqual("1h 30m", retorno);
            #endregion
            #region Dias
            retorno = JiraTiempos.Evaluar($"{1 * 60 * 8}m");
            Assert.AreEqual("1d", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 60 * 8 + 7 * 60}m");
            Assert.AreEqual("1d 7h", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 60 * 8 + 7 * 60 + 30 }m");
            Assert.AreEqual("1d 7h 30m", retorno);
            #endregion
            #region Semanas
            retorno = JiraTiempos.Evaluar($"{2 * 60 * 8 * 5  }m");
            Assert.AreEqual("2w", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 60 * 8 * 5 + 4 * 60 * 8  }m");
            Assert.AreEqual("1w 4d", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 60 * 8 * 5 + 4 * 60 * 8 + 7 * 60 }m");
            Assert.AreEqual("1w 4d 7h", retorno);

            retorno = JiraTiempos.Evaluar($"{1 * 60 * 8 * 5 + 4 * 60 * 8 + 7 * 60 + 30 }m");
            Assert.AreEqual("1w 4d 7h 30m", retorno);
            #endregion
            #region Mes
            retorno = JiraTiempos.Evaluar($"{3 * 60  * 8 * 5 * 4}m");
            Assert.AreEqual("3M", retorno);

            retorno = JiraTiempos.Evaluar($"{3  * 60 * 8 * 5 * 4 + 2 * 60  * 8 * 5  }m");
            Assert.AreEqual("3M 2w", retorno);

            retorno = JiraTiempos.Evaluar($"{3 * 60 * 8 * 5 * 4 + 1 * 60 * 8 * 5 + 4 * 60  * 8  }m");
            Assert.AreEqual("3M 1w 4d", retorno);

            retorno = JiraTiempos.Evaluar($"{3 * 60  * 8 * 5 * 4 + 1 * 60  * 8 * 5 + 4 * 60  * 8 + 7 * 60 }m");
            Assert.AreEqual("3M 1w 4d 7h", retorno);

            retorno = JiraTiempos.Evaluar($"{3 * 60  * 8 * 5 * 4 + 1 * 60 * 8 * 5 + 4 * 60  * 8 + 7  * 60 + 30 }m");
            Assert.AreEqual("3M 1w 4d 7h 30m", retorno);
            #endregion
            #region Años
            retorno = JiraTiempos.Evaluar($"{2 * 60 * 8 * 5 * 4 * 12}m");
            Assert.AreEqual("2a", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 60 * 8 * 5 * 4 * 12 + 3  * 60 * 8 * 5 * 4}m");
            Assert.AreEqual("2a 3M", retorno);

            retorno = JiraTiempos.Evaluar($"{2 * 60 * 8 * 5 * 4 * 12 + 3  * 60 * 8 * 5 * 4 + 2  * 60 * 8 * 5  }m");
            Assert.AreEqual("2a 3M 2w", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 8 * 5 * 4 + 1  * 60 * 8 * 5 + 4 * 60 * 8  }m");
            Assert.AreEqual("2a 3M 1w 4d", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 60 * 8 * 5 * 4 * 12 + 3 * 60 * 8 * 5 * 4 + 1  * 60 * 8 * 5 + 4  * 60 * 8 + 7 * 60 }m");
            Assert.AreEqual("2a 3M 1w 4d 7h", retorno);

            retorno = JiraTiempos.Evaluar($"{2  * 60 * 8 * 5 * 4 * 12 + 3  * 60 * 8 * 5 * 4 + 1  * 60 * 8 * 5 + 4  * 60 * 8 + 7  * 60 + 30 }m");
            Assert.AreEqual("2a 3M 1w 4d 7h 30m", retorno);
            #endregion
        }