예제 #1
0
        public static void Register(Type type)
        {
            var blend = Blend.From(type);

            Recipe.AssertValid(blend, type);
            invokers.Add(type, Bind(blend.ToString()));
        }
예제 #2
0
        public void Blend_from_worker_with_both_methods_attributed()
        {
            Blend blend = Blend.From(typeof(WorkerWithInterleave));

            Assert.That(blend.Flavors, Contains.Item(Activation.StatelessWorker));
            Assert.That(blend.Flavors, Contains.Item(Concurrency.Default));
            Assert.That(blend.Flavors, Contains.Item(Placement.Default));
            Assert.That(blend.Flavors, Contains.Item(Delivery.Default));
            Assert.That(blend.Flavors, Contains.Item(Interleave.Both));
        }
예제 #3
0
        public void Blend_from_unordered_stateless_worker()
        {
            Blend blend = Blend.From(typeof(UnorderedStatelessWorker));

            Assert.That(blend.Flavors, Contains.Item(Activation.StatelessWorker));
            Assert.That(blend.Flavors, Contains.Item(Concurrency.Default));
            Assert.That(blend.Flavors, Contains.Item(Placement.Default));
            Assert.That(blend.Flavors, Contains.Item(Delivery.Unordered));
            Assert.That(blend.Flavors, Contains.Item(Interleave.Default));
        }
예제 #4
0
        public void Blend_from_singleton_with_tell_method_attributed()
        {
            Blend blend = Blend.From(typeof(TellInterleave));

            Assert.That(blend.Flavors, Contains.Item(Activation.Singleton));
            Assert.That(blend.Flavors, Contains.Item(Concurrency.Default));
            Assert.That(blend.Flavors, Contains.Item(Placement.Default));
            Assert.That(blend.Flavors, Contains.Item(Delivery.Default));
            Assert.That(blend.Flavors, Contains.Item(Interleave.Tell));
        }
예제 #5
0
        public void Blend_from_non_attributed_type()
        {
            Blend blend = Blend.From(typeof(RegularSingleton));

            Assert.That(blend.Flavors, Contains.Item(Activation.Singleton));
            Assert.That(blend.Flavors, Contains.Item(Concurrency.Default));
            Assert.That(blend.Flavors, Contains.Item(Placement.Default));
            Assert.That(blend.Flavors, Contains.Item(Delivery.Default));
            Assert.That(blend.Flavors, Contains.Item(Interleave.Default));
        }