Example #1
0
        public void AddGeneric()
        {
            var builder = new JobHostBuilder();

            builder.Add <TestJob>();

            var host = builder.Build();

            Assert.Single(host.Jobs);
        }
Example #2
0
        public void AddInstance()
        {
            var job     = new TestJob();
            var builder = new JobHostBuilder();

            builder.Add(job);

            var host = builder.Build();

            Assert.Equal(new[] { job }, host.Jobs);
        }
Example #3
0
        public void AddFactory()
        {
            var job     = new TestJob();
            var builder = new JobHostBuilder();

            builder.Add(() => job);

            var host = builder.Build();

            Assert.Equal(new[] { job }, host.Jobs);
        }