Ejemplo n.º 1
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 );
        }
Ejemplo n.º 2
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 );
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 5
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 );
        }
Ejemplo n.º 6
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);
        }