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); }
// 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; }
public void Ctor_ThrowsAnException_WhenLifetimeScopeIsNull() { // ReSharper disable once UnusedVariable var activator = new UnityJobActivator(null); }