Inheritance: SqlJobExtension.SqlJob
        public void ErroredSqlJobShouldNotHaltJobQeueueExecution()
        {
            var job = new SqlJobToFail();
            job.SetParameters(DateTime.Parse("1/1/2012"));
            JobQueue.Enqueue(job);

            JobQueue.Execute();
            JobQueue.Count.ShouldEqual(0);
            JobQueue.ErroredJobs.Count().ShouldEqual(1);
        }
Beispiel #2
0
        public void FailedSqlJobShouldExecuteUndoTask()
        {
            var job = new SqlJobToFail();
            job.SetParameters(DateTime.Parse("1/1/2012"));
            try
            {
                job.Execute();
            } catch
            {
                job.Undo();
            }

            var cmd = new SqlCommand("select top 1 LogText from TestLogs order by id desc", job.Connection);
            var returnValue = cmd.ExecuteScalar();
            returnValue.ShouldEqual("01 Undo");
        }