예제 #1
0
        public void EventosEntidad_AtributodtTiempoEvento_ComprobarValor()
        {
            EventosEntidad eventosEntidad = new EventosEntidad();

            eventosEntidad.dtTiempoEvento = new DateTime(1, 1, 12);

            Assert.AreEqual(new DateTime(1, 1, 12), eventosEntidad.dtTiempoEvento);
        }
예제 #2
0
        public void EventosEntidad_AtributocNombreEvento_ComprobarValor()
        {
            EventosEntidad eventosEntidad = new EventosEntidad();

            eventosEntidad.cNombreEvento = "Dia bot";

            Assert.AreEqual("Dia bot", eventosEntidad.cNombreEvento);
        }
        private string CrearMensajeEvento(EventosEntidad oEvento)
        {
            TimeSpan dtCompararTiempo = oEvento.dtTiempoEvento.Subtract(Obtenerfecha());
            int      tiempo           = dtCompararTiempo.Days;

            string cTipoMensaje = tiempo >= 0 && dtCompararTiempo.Hours > 0 ? "ocurrirá dentro de" : "ocurrió hace";

            ICalcularTiempos CalculadorTiempo = ObtenerTipoDeTiempoDeEvento(dtCompararTiempo);

            string cMensaje = $"{oEvento.cNombreEvento} {cTipoMensaje} {CalculadorTiempo.CalcularTiempo(dtCompararTiempo)}";

            return(cMensaje);
        }