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

            builder.Add <TestJob>();

            var host = builder.Build();

            Assert.Single(host.Jobs);
        }
예제 #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);
        }
예제 #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);
        }