public void LaFechaDeInicioNoPuedeSerMayorALaDeFin()
        {
            var fechaInicio = new DateTime(2021, 03, 20);
            var fechaFin    = new DateTime(2021, 02, 20);
            var jefeDpto    = JefeDptoMother.CreateJefeDpto("1234");

            _jefeDptoRepository.Add(jefeDpto);
            _dbContext.SaveChanges();
            var request  = new PlazoAperturaRequest("1234", fechaInicio, fechaFin);
            var response = _plazoAperturaService.CrearPlazoApertura(request);

            Assert.AreEqual("La fecha de inicio no puede ser mayor o igual a la fecha de fin", response.Message);
        }
Exemple #2
0
        public void PuedoAsignarActividadAUnDocente()
        {
            var docente  = DocenteMother.CreateDocente("103523423");
            var jefeDpto = JefeDptoMother.CreateJefeDpto("11223334");

            _usuarioRepository.Add(jefeDpto);
            _usuarioRepository.Add(docente);
            var tipo = new TipoActividad("Investigaci�n");

            _tipoActividadRepository.Add(tipo);
            _dbContext.SaveChanges();
            var request  = new ActividadRequest(1, "11223334", "103523423", 10);
            var response = _asignarActividadService.Handle(request);

            response.Message.Should().Be("Se asignaron 10 horas de Investigaci�n al docente Sebastian");
        }
Exemple #3
0
        public void PuedeGuardarJefeDptoTest()
        {
            var jefeDpto = JefeDptoMother.CreateJefeDpto("12141411");

            _departamentoRepository.Add(jefeDpto.Departamento);
            _dbContext.SaveChanges();
            var request = new JefeDptoRequest(
                jefeDpto.Identificacion,
                jefeDpto.Nombres,
                jefeDpto.Apellidos,
                jefeDpto.Email,
                jefeDpto.Sexo,
                jefeDpto.Departamento.Id
                );
            var response = _crearJefeDptoService.Handle(request).Mensaje;

            Assert.AreEqual("Se registró correctamente el Jefe de departamento Kelly", response);
        }
Exemple #4
0
        public void PuedeGuardarDocenteTest()
        {
            var docente = DocenteMother.CreateDocente("12141411");

            _departamentoRepository.Add(docente.Departamento);
            _dbContext.SaveChanges();
            var request = new DocenteRequest(
                docente.Identificacion,
                docente.Nombres,
                docente.Apellidos,
                docente.Email,
                docente.Sexo,
                docente.Departamento.Id
                );
            var response = _crearDocenteService.Handle(request).Mensaje;

            Assert.AreEqual("Se registró correctamente el docente Sebastian", response);
        }
        public void PuedoCrearPlanDeAccion()
        {
            var actividad = ActividadMother.CreateActividad();

            _actividadRepository.Add(actividad);
            _dbContext.SaveChanges();
            var plazo        = PlazoAperturaMother.CreatePlazoApertura("123313");
            var plazoRequest = new PlazoAperturaRequest("123313", plazo.FechaInicio, plazo.FechaFin);

            _plazoAperturaService.CrearPlazoApertura(plazoRequest).Message.Should().Be("El plazo fue correctamente ingresado");
            var item  = new ItemPlanRequest(0, "Se describe aqui", "Se describe lo que se hizo", "loquesea/dir");
            var items = new List <ItemPlanRequest>();

            items.Add(item);
            var request  = new PlanAccionRequest(1, items);
            var response = _crearPlanAccionService.Handle(request);

            response.Message.Should().Be("Plan de accion registrado correctamente");
        }
Exemple #6
0
        public void PuedoCrearItemPlanDeAccion()
        {
            var plan = PlanAccionMother.CreatePlanAccion();

            _planAccionRepository.Add(plan);
            _dbContext.SaveChanges();
            var plazo        = PlazoAperturaMother.CreatePlazoApertura("123313");
            var plazoRequest = new PlazoAperturaRequest("123313", plazo.FechaInicio, plazo.FechaFin);

            _plazoAperturaService.CrearPlazoApertura(plazoRequest).Message.Should().Be("El plazo fue correctamente ingresado");
            var request  = new ItemPlanRequest(1, "Se describe aqui", "Se describe lo que se hizo", "loquesea/dir");
            var response = _itemPlanService.RegistrarItem(request);

            response.Message.Should().Be("Item registrado correctamente");
        }