Esempio n. 1
0
        public void TestControllerScheduledJobFailDate()
        {
            ICronApiService          cron          = new MockCronApiService();
            IProgramingMethodService methodService = new MockProgramingMethodService();
            ScheduledJobController   controller    = new ScheduledJobController(cron, methodService, null);
            var result = controller.AddScheduledJob("07/25/2001 12:36", Guid.NewGuid().ToString());

            if (result is BadRequestObjectResult)
            {
                Assert.True(true);
            }
            else
            {
                Assert.True(false);
            }
        }
Esempio n. 2
0
        public void TestControllerScheduledJobBadGuid()
        {
            ICronApiService          cron          = new MockCronApiService();
            IProgramingMethodService methodService = new MockProgramingMethodService();
            ScheduledJobController   controller    = new ScheduledJobController(cron, methodService, null);
            var result = controller.AddScheduledJob("07/05/2021 12:36", "1321-e", "07/05/2001 12:36");

            if (result is BadRequestObjectResult)
            {
                Assert.True(((BadRequestObjectResult)result).Value.Equals("identificador invalido"));
            }
            else
            {
                Assert.True(false);
            }
        }
Esempio n. 3
0
        public void TestControllerScheduledJobFailWithoutDate()
        {
            ICronApiService          cron          = new MockCronApiService();
            IProgramingMethodService methodService = new MockProgramingMethodService();
            ScheduledJobController   controller    = new ScheduledJobController(cron, methodService);
            var result = controller.AddScheduledJob(null, Guid.NewGuid().ToString());

            if (result is BadRequestObjectResult)
            {
                Assert.True(((BadRequestObjectResult)result).Value.Equals("La fecha de ejecución es obligatoria"));
            }
            else
            {
                Assert.True(false);
            }
        }