protected void btnRun_Click(object sender, RowEventArgs e)
        {
            var               testId             = e.RowKeyId;
            RockContext       rockContext        = new RockContext();
            SystemTestService monitorTestService = new SystemTestService(rockContext);
            var               monitorTest        = monitorTestService.Get(testId);
            var               response           = monitorTest.Run();

            maNotification.Show("Result: " + response.Passed.ToString(), ModalAlertType.Information);
        }
        private SystemTest GetMonitorTest(SystemTestService monitorTestService)
        {
            var testId      = PageParameter("MonitorTestId").AsInteger();
            var monitorTest = monitorTestService.Get(testId);

            if (monitorTest == null)
            {
                monitorTest = new SystemTest();
            }
            return(monitorTest);
        }
Beispiel #3
0
        public string RunTest(int id)
        {
            RockContext       rockContext       = new RockContext();
            SystemTestService systemTestService = new SystemTestService(rockContext);
            var test   = systemTestService.Get(id);
            var result = test.Run();

            if (result.Passed)
            {
                return("Passed");
            }
            //if we fail throw an exception for a 500 status
            throw new Exception("Failed");
        }
Beispiel #4
0
        public IHttpActionResult RunTest(int id)
        {
            RockContext       rockContext       = new RockContext();
            SystemTestService systemTestService = new SystemTestService(rockContext);
            var test   = systemTestService.Get(id);
            var result = test.Run();

            if (result.Passed)
            {
                return(Ok("Passed"));
            }
            //if we fail throw an exception for a 500 status
            return(InternalServerError(new Exception("System Test Failed")));
        }