Пример #1
0
        public void puzzleContainer_isRegistered_using_non_registered_type_shuold_return_false()
        {
            var container = new PuzzleContainer();

            var actual = container.IsRegistered <int>();

            Assert.IsFalse(actual);
        }
Пример #2
0
        public void puzzleContainer_register_entry_should_report_entry_as_registered()
        {
            var container = new PuzzleContainer();

            container.Register(EntryBuilder.For <Object>());
            var actual = container.IsRegistered <Object>();

            Assert.IsTrue(actual);
        }
Пример #3
0
        public void PuzzleContainer_entryBuilder_should_support_contract_forwarding()
        {
            var entry = EntryBuilder.For <IFoo>()
                        .Forward <IBar>()
                        .ImplementedBy <TypeWithMultipleContracts>();

            var sut = new PuzzleContainer();

            sut.Register(entry);

            var actual = sut.IsRegistered <IBar>();

            Assert.IsTrue(actual);
        }
Пример #4
0
        public void PuzzleContainer_entryBuilder_should_support_contract_forwarding()
        {
            var entry = EntryBuilder.For<IFoo>()
                .Forward<IBar>()
                .ImplementedBy<TypeWithMultipleContracts>();

            var sut = new PuzzleContainer();
            sut.Register( entry );

            var actual = sut.IsRegistered<IBar>();

            Assert.IsTrue( actual );
        }
Пример #5
0
        public void puzzleContainer_isRegistered_using_non_registered_type_shuold_return_false()
        {
            var container = new PuzzleContainer();

            var actual = container.IsRegistered<Int32>();

            Assert.IsFalse( actual );
        }
Пример #6
0
        public void puzzleContainer_register_entry_should_report_entry_as_registered()
        {
            var container = new PuzzleContainer();

            container.Register( EntryBuilder.For<Object>() );
            var actual = container.IsRegistered<Object>();

            Assert.IsTrue( actual );
        }