public void ActivateJobCallsUnity()
 {
     var container = new UnityContainer();
     container.RegisterInstance(typeof(string), "called");
     var activator = new UnityJobActivator(container);
     var result = activator.ActivateJob(typeof(string));
     Assert.AreEqual("called", result);
 }
示例#2
0
        public void ActivateJobCallsUnity()
        {
            var container = new UnityContainer();

            container.RegisterInstance(typeof(string), "called");
            var activator = new UnityJobActivator(container);
            var result    = activator.ActivateJob(typeof(string));

            Assert.AreEqual("called", result);
        }
示例#3
0
        // Please set the following connection strings in app.config for this WebJob to run:
        // AzureWebJobsDashboard and AzureWebJobsStorage
        static void Main()
        {
            var container    = new UnityContainer();
            var bootstrapper = new DependencyBootstrapper();

            bootstrapper.Configure(container);
            var activator = new UnityJobActivator(container);
            var host      = new JobHost(new JobHostConfiguration {
                JobActivator = activator
            });

            // The following code ensures that the WebJob will be running continuously
            host.RunAndBlock();
        }
 public void ClassIsBasedOnJobActivator()
 {
     var activator = new UnityJobActivator(new UnityContainer());
     Assert.IsInstanceOfType(activator, typeof(JobActivator));
 }
 public void ConstructorThrowsAnExceptionWhenContainerIsNull()
 {
     var activator = new UnityJobActivator(null);
 }
 public ChildContainerPerJobFilterAttribute(UnityJobActivator unityJobActivator)
 {
     UnityJobActivator = unityJobActivator;
 }
示例#7
0
 public void Ctor_ThrowsAnException_WhenLifetimeScopeIsNull()
 {
     // ReSharper disable once UnusedVariable
     var activator = new UnityJobActivator(null);
 }
示例#8
0
        public void ClassIsBasedOnJobActivator()
        {
            var activator = new UnityJobActivator(new UnityContainer());

            Assert.IsInstanceOfType(activator, typeof(JobActivator));
        }
示例#9
0
 public void ConstructorThrowsAnExceptionWhenContainerIsNull()
 {
     var activator = new UnityJobActivator(null);
 }