Esempio n. 1
0
        public void puzzleContainer_addFacility_using_non_generic_method_and_valid_facility_should_behave_as_expected()
        {
            var container = new PuzzleContainer();

            var facility = new MyFacility();
            container.AddFacility( facility );
        }
Esempio n. 2
0
        public void puzzleContainer_addFacility_using_non_generic_method_and_valid_facility_should_behave_as_expected()
        {
            var container = new PuzzleContainer();

            var facility = new MyFacility();

            container.AddFacility(facility);
        }
Esempio n. 3
0
        public void puzzleContainer_addFacility_using_generic_method_and_valid_facility_should_initialize_the_new_facility()
        {
            var container = new PuzzleContainer();
            container.AddFacility<MyFacility>();
            var facility = container.GetFacilities()
                .OfType<MyFacility>()
                .Single();

            Assert.IsTrue( facility.InitializeCalled );
        }
Esempio n. 4
0
        public void puzzleContainer_addFacility_using_generic_method_and_valid_facility_should_behave_as_expected()
        {
            var container = new PuzzleContainer();
            container.AddFacility<MyFacility>();
            var facility = container.GetFacilities()
                .OfType<MyFacility>()
                .SingleOrDefault();

            Assert.IsNotNull( facility );
        }
Esempio n. 5
0
        public void puzzleContainer_addFacility_using_non_generic_method_and_valid_facility_should_initialize_the_new_facility()
        {
            var container = new PuzzleContainer();

            var facility = new MyFacility();

            container.AddFacility(facility);

            Assert.IsTrue(facility.InitializeCalled);
        }
Esempio n. 6
0
        public void puzzleContainer_addFacility_using_generic_method_and_valid_facility_should_initialize_the_new_facility()
        {
            var container = new PuzzleContainer();

            container.AddFacility <MyFacility>();
            var facility = container.GetFacilities()
                           .OfType <MyFacility>()
                           .Single();

            Assert.IsTrue(facility.InitializeCalled);
        }
Esempio n. 7
0
        public void puzzleContainer_addFacility_using_generic_method_and_valid_facility_should_behave_as_expected()
        {
            var container = new PuzzleContainer();

            container.AddFacility <MyFacility>();
            var facility = container.GetFacilities()
                           .OfType <MyFacility>()
                           .SingleOrDefault();

            Assert.IsNotNull(facility);
        }
Esempio n. 8
0
        public void puzzleContainer_on_dispose_should_teardown_facilities()
        {
            MyFacility facility;

            using ( var container = new PuzzleContainer() )
            {
                container.AddFacility<MyFacility>();
                facility = container.GetFacilities()
                    .OfType<MyFacility>()
                    .Single();
            }

            Assert.IsTrue( facility.TeardownCalled );
        }
Esempio n. 9
0
        public void puzzleContainer_on_dispose_should_teardown_facilities()
        {
            MyFacility facility;

            using (var container = new PuzzleContainer())
            {
                container.AddFacility <MyFacility>();
                facility = container.GetFacilities()
                           .OfType <MyFacility>()
                           .Single();
            }

            Assert.IsTrue(facility.TeardownCalled);
        }
        public void when_registering_POCO_message_handler_facility_should_correctly_subscribe_messages()
        {
            var container = new PuzzleContainer();

            container.AddFacility <SubscribeToMessageFacility>();
            container.Register(EntryBuilder.For <IMessageBroker>().UsingInstance(new MessageBroker(new NullDispatcher())));

            container.Register(EntryBuilder.For <IHandleMessage <AMessage> >().ImplementedBy <AMessageHandler>());

            var broker  = container.Resolve <IMessageBroker>();
            var handler = (AMessageHandler)container.Resolve <IHandleMessage <AMessage> >();

            broker.Dispatch(this, new AMessage());

            Assert.IsTrue(handler.Invoked);
        }
Esempio n. 11
0
        public void puzzleContainer_addFacility_using_non_generic_method_and_valid_facility_should_initialize_the_new_facility()
        {
            var container = new PuzzleContainer();

            var facility = new MyFacility();
            container.AddFacility( facility );

            Assert.IsTrue( facility.InitializeCalled );
        }
Esempio n. 12
0
 public void puzzleContainer_addFacility_using_null_reference_should_raise_ArgumentNullException()
 {
     var container = new PuzzleContainer();
     container.AddFacility( null );
 }
Esempio n. 13
0
        public void puzzleContainer_addFacility_using_null_reference_should_raise_ArgumentNullException()
        {
            var container = new PuzzleContainer();

            container.AddFacility(null);
        }