Example #1
0
        public void UseJobContextTest()
        {
            DateTime myDob = new DateTime(2001, 04, 01);
            FakeJobContextClass classStoredInContext = new FakeJobContextClass();

            JobContext ctx = new JobContext(this.FakeLogger);
            ctx.Data.Add("name", "bill");
            ctx.Data.Add("dob", myDob);
            ctx.Data.Add("aclass", classStoredInContext);

            Assert.Equal("bill", ctx.Data["name"].ToString());
            Assert.Equal(myDob, (DateTime) ctx.Data["dob"]);
            Assert.Equal(false, ((FakeJobContextClass) ctx.Data["aclass"]).Disposed);

            ctx.Dispose();

            Assert.True(classStoredInContext.Disposed);
        }
Example #2
0
 public FakeSimpleCommand(ILogProvider log, JobContext ctx) 
     : base(log, ctx) { }
Example #3
0
 protected BaseCommand(ILogProvider log, JobContext ctx)
 {
     this.Log = log;
     this.Context = ctx;
 }
Example #4
0
 public HelloWorldCommand(ILogProvider log, JobContext ctx)
     : base(log, ctx)
 {
 }