Ejemplo n.º 1
0
        public void Can_Run_Jobs_With_Static_Method()
        {
            var next  = JobCreator.Create <SampleJobStaticMethod>((j) => SampleJobStaticMethod.DoThing());
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
            Xunit.Assert.True(SampleJobStaticMethod.Called);
        }
Ejemplo n.º 2
0
        public void Creator_Respects_StaticJob_Handling()
        {
            var next  = JobCreator.Create <StaticClassJob>((j) => SampleJobStaticClass.DoThing());
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
            Xunit.Assert.True(SampleJobStaticClass.Called);
        }
Ejemplo n.º 3
0
        public void Can_Run_Jobs_With_No_Params()
        {
            var next  = JobCreator.Create <SampleJobNoParam>((j) => j.DoThing());
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
            Xunit.Assert.True(SampleJobNoParam.Called);
        }
Ejemplo n.º 4
0
        public void Can_Run_Static_Method_On_Static_Class()
        {
            var next  = JobCreator.Create <object>((j) => SampleJobStaticClass.DoThing());
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
            Xunit.Assert.True(SampleJobStaticClass.Called);
        }
Ejemplo n.º 5
0
        public void Can_Run_Jobs_With_Param_Type_Matching_And_Overloads()
        {
            var myValue = new ClassTest()
            {
                classTestValue = TestConstants.classTestValue
            };
            var next  = JobCreator.Create <SampleJob2>((j) => j.DoThing(TestConstants.derp, TestConstants.herp, myValue));
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
        }
Ejemplo n.º 6
0
        public void Can_Run_Job_With_Simple_Method_Calls()
        {
            var myValue = new ClassTest()
            {
                classTestValue = TestConstants.classTestValue
            };
            var next  = JobCreator.Create <SampleJob>((j) => j.DoThing(TestConstants.derp, int.Parse(TestConstants.herp.ToString()), myValue));
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
        }
Ejemplo n.º 7
0
        public void Can_Run_Job_And_pass_parameters()
        {
            var myValue = new ClassTest()
            {
                classTestValue = TestConstants.classTestValue
            };
            var next  = JobCreator.Create <SampleJob>((j) => j.DoThing(TestConstants.derp, TestConstants.herp, myValue));
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
        }
Ejemplo n.º 8
0
        public void Can_Run_Job_With_Arity_in_class_With_Arity()
        {
            var myvalue = new ClassTest()
            {
                classTestValue = TestConstants.classTestValue
            };
            var next = JobCreator.Create <SampleJobInGenericClass <string> >(j =>
                                                                             j.DoThing(TestConstants.derp, TestConstants.herp, myvalue));
            var jobEx = new DefaultJobExecutor(new DefaultContainerFactory());

            jobEx.ExecuteJob(next);
        }