main
 1using developwithpassion.bdd.contexts;
 2using Gorilla.Commons.Infrastructure.Container;
 3using Gorilla.Commons.Testing;
 4using gorilla.commons.Utility;
 5
 6namespace momoney.service.infrastructure.threading
 7{
 8    [Concern(typeof (BackgroundThreadFactory))]
 9    public abstract class behaves_like_a_background_thread_factory : concerns_for<IBackgroundThreadFactory, BackgroundThreadFactory>
10    {
11        context c = () =>
12        {
13            registry = the_dependency<DependencyRegistry>();
14        };
15
16        static protected DependencyRegistry registry;
17    }
18
19    [Concern(typeof (BackgroundThreadFactory))]
20    public class when_creating_a_background_thread : behaves_like_a_background_thread_factory
21    {
22        it should_return_an_instance_of_a_background_thread = () => result.should_not_be_null();
23
24        it should_lookup_an_instance_of_the_command_to_execute =
25            () => registry.was_told_to(r => r.get_a<DisposableCommand>());
26
27        because b = () =>
28        {
29            result = sut.create_for<DisposableCommand>();
30        };
31
32        static IBackgroundThread result;
33    }
34}