Ejemplo n.º 1
0
        public async Task Test_JobCreateAndDelete()
        {
            BL_Job businessLogic = new BL_Job(null, true);


            Job newjob = new Job()
            {
                JobTitle    = ".NET Developer",
                Description = ".NET Developer Description",
                CreatedAt   = DateTime.Now,
                ExpiredAt   = DateTime.Now.AddDays(30)
            };

            await businessLogic.CreateJob(newjob);

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

            //Assert.AreEqual(true, exists);

            await businessLogic.DeleteJob(newjob);

            exists = businessLogic.JobExists(newjob.IdJob);

            Assert.AreEqual(false, exists);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdJob,JobTitle,Description,CreatedAt,ExpiredAt")] Job job)
        {
            if (ModelState.IsValid)
            {
                await businessLogicJob.CreateJob(job);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(job));
        }
Ejemplo n.º 3
0
        public async Task Test_JobCreateAndUpdate()
        {
            BL_Job businessLogic = new BL_Job(null, true);


            Job newjob = new Job()
            {
                JobTitle    = ".NET Developer",
                Description = ".NET Developer Description",
                CreatedAt   = DateTime.Now,
                ExpiredAt   = DateTime.Now.AddDays(30)
            };

            string jobTittle = ".NET Developer";
            await businessLogic.CreateJob(newjob);

            newjob.JobTitle = ".NET Developer 2";

            await businessLogic.UpdateJob(newjob);

            Assert.AreEqual(true, (jobTittle != newjob.JobTitle));
        }