Esempio n. 1
0
 public ActionResult <PersonLegal> PostPersonLegal(PersonLegal person, [FromServices] PersonApplication personApplication)
 {
     try
     {
         return(personApplication.PostPersonLegal(person));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Esempio n. 2
0
        public void Person_GetName_NotFirstName()
        {
            var message   = $"No se ingreso el nombre";
            var firstName = "";
            var lastName  = "gutierrez";

            var personApplication = new PersonApplication(new PersonRepository());
            var result            = personApplication.GetCompleteName(firstName, lastName);

            Assert.True(result == message);
        }
Esempio n. 3
0
        public void Person_GetName_Success()
        {
            var resultado = $"walberth gutierrez";
            var firstName = "walberth";
            var lastName  = "gutierrez";

            var personApplication = new PersonApplication(new PersonRepository());
            var result            = personApplication.GetCompleteName(firstName, lastName);

            Assert.True(result == resultado);
        }
        public void Add()
        {
            PersonApplication personApplication = new PersonApplication()
            {
                FromDepartmentPositionId = 1,
                ToDepartmentPositionId   = 2,
                PersonApplicationTypeId  = 1,
                PersonId = 1,
                Date     = DateTime.Now
            };

            var result = _unitOfWork.Repository <PersonApplication>().Add(personApplication);

            Assert.IsTrue(result.IsSuccess);
        }
Esempio n. 5
0
        public void Person_ConcatenateTwoNames_Success2()
        {
            var person         = "";
            var firstPerson    = "";
            var secondPerson   = "";
            var expectedResult = "walberth,angela";


            var mockRepository = new Mock <IPersonRepository>();

            mockRepository.Setup(x => x.GetPersonCompleteName(person))
            .Returns(new Queue <string>(new [] { "walberth", "angela" }).Dequeue);

            var personApplication = new PersonApplication(mockRepository.Object);
            var result            = personApplication.ConcatenateTwoNames(firstPerson, secondPerson);

            Assert.True(result == expectedResult);
        }
Esempio n. 6
0
        public void Person_PersonNames_Success()
        {
            var nombres = new List <string>();

            nombres.Add("Walberth");
            nombres.Add("Angela");
            nombres.Add("otro Nombre");
            nombres.Add("otro nombre más");

            var mockRepository = new Mock <IPersonRepository>();

            mockRepository.Setup(x => x.PersonNames()).Returns(nombres);

            var personApplication = new PersonApplication(mockRepository.Object);
            var result            = personApplication.PersonNames();

            Assert.NotNull(result);
        }
Esempio n. 7
0
 public ActionResult <IEnumerable <PersonPhysical> > GetAllPersonPhysical([FromServices] PersonApplication personApplication)
 {
     return(personApplication.GetAllPersonPhysical().ToList());
 }
Esempio n. 8
0
 public HomeController()
 {
     personApplication = new PersonApplication();
 }