Пример #1
0
        public void PrepareCompositionWithNullConstructorSelector()
        {
            Assert.Throws <ArgumentNullException>(
                () =>
            {
                var component = new SingletonComponent <ITestComponent, TestComponent>();

                component.PrepareComposition(this.Composer, null);
            });
        }
Пример #2
0
        public void PrepareComposition()
        {
            var composer  = Mock.Of <IComponentComposer>();
            var component = new SingletonComponent <ITestComponent, TestComponent>();

            component.PrepareComposition(composer, this.ConstructorSelector);

            var mockComposer = Mock.Get(composer);

            mockComposer.Verify(
                c => c.PrepareToComposeUsingConstructor(typeof(TestComponent), this.ConstructorSelector),
                Times.Once);
        }