Exemplo n.º 1
0
        public async Task <ActionResult <JobEntity> > GetJob(int id)
        {
            var jobEntity = await logic.GetJob(id);

            if (jobEntity == null)
            {
                return(NotFound());
            }

            return(jobEntity);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            JobEntity = await logic.GetJob((int)id);

            if (JobEntity == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        // GET: JobEntities/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var jobEntity = await jobslogic.GetJob((int)id);

            if (jobEntity == null)
            {
                return(NotFound());
            }

            return(View(jobEntity));
        }
Exemplo n.º 4
0
        public async Task Test_BL_UpdateJob()
        {
            //Arrange
            JobBusinessLogic businessLogic = new JobBusinessLogic(inMemory: true);
            JobEntity        newjob        = new JobEntity()
            {
                JobId     = 1,
                Title     = "Backend Senior Developer",
                CreatedAt = DateTime.Now,
                ExpiresAt = DateTime.Now.AddDays(30)
            };

            //Act
            await businessLogic.CreateJob(newjob);

            var exists = businessLogic.JobExists(newjob.JobId);

            //Assert
            Assert.True(exists, "Job created");

            //Act
            newjob.Title = ".NET Developer";
            await businessLogic.UpdateJob(newjob);

            var updatedJob = await businessLogic.GetJob(newjob.JobId);

            //Assert
            Assert.True(updatedJob.Title == ".NET Developer", "Job updated");
        }