main
 1using Gorilla.Commons.Infrastructure.Container;
 2using Gorilla.Commons.Infrastructure.Logging;
 3
 4namespace tests.unit.commons.infrastructure
 5{
 6    [Concern(typeof (Log))]
 7    public class when_creating_a_logger_for_a_particular_type_ : concerns
 8    {
 9        it should_return_the_logger_created_for_that_type = () => result.should_be_equal_to(logger);
10
11        context c =
12            () =>
13            {
14                var factory = an<LogFactory>();
15                var registry = an<DependencyRegistry>();
16                logger = an<Logger>();
17                registry.is_told_to(x => x.get_a<LogFactory>()).it_will_return(factory);
18                factory.is_told_to(x => x.create_for(typeof (string))).it_will_return(logger);
19
20                Resolve.initialize_with(registry);
21            };
22
23        because b = () =>
24        {
25            result = Log.For("mo");
26        };
27
28        after_all a = () => Resolve.initialize_with(null);
29
30        static Logger result;
31        static Logger logger;
32    }
33}