Пример #1
0
        public void TestControllerJobBadGuid()
        {
            ICronApiService          cron          = new MockCronApiService();
            IProgramingMethodService methodService = new MockProgramingMethodService();
            JobController            controller    = new JobController(cron, methodService, null);
            var result = controller.AddExecution("1231-11ef-12", "07/05/2022 12:36", "07/05/2001 12:36");

            if (result is BadRequestObjectResult)
            {
                Assert.True(((BadRequestObjectResult)result).Value.Equals("identificador invalido"));
            }
            else
            {
                Assert.True(false);
            }
        }
Пример #2
0
        public void TestControllerJobBadParams()
        {
            ICronApiService          cron          = new MockCronApiService();
            IProgramingMethodService methodService = new MockProgramingMethodService();
            JobController            controller    = new JobController(cron, methodService, null);
            var result = controller.AddExecution(Guid.NewGuid().ToString(), "07/05/2022 12:36", null, "12");

            if (result is BadRequestObjectResult)
            {
                Assert.True(((BadRequestObjectResult)result).Value.Equals("falta el tipo de objeto"));
            }
            else
            {
                Assert.True(false);
            }
        }
Пример #3
0
        public void TestControllerJobWithoutDate()
        {
            ICronApiService          cron          = new MockCronApiService();
            IProgramingMethodService methodService = new MockProgramingMethodService();
            JobController            controller    = new JobController(cron, methodService, null);
            var result = controller.AddExecution(Guid.NewGuid().ToString(), null);

            if (result is BadRequestObjectResult)
            {
                Assert.True(false);
            }
            else
            {
                Assert.True(true);
            }
        }