コード例 #1
0
        public void FluentDecoratorWithCtor_IsDynamic([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                      FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            configuration.IsDynamic();

            Assert.True(constructorParameterInfo.IsDynamic);
        }
コード例 #2
0
        public void FluentDecoratorWithCtor_Named([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                  FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            configuration.Named("Test");

            Assert.Equal("Test", constructorParameterInfo.ParameterName);
        }
コード例 #3
0
        public void FluentDecoratorWithCtor_When([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                 [Freeze] IFluentDecoratorStrategyConfiguration strategyConfiguration,
                                                 FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            configuration.When.InjectedInto <BasicService>();

            strategyConfiguration.Received().When.InjectedInto <BasicService>();
        }
コード例 #4
0
        public void FluentDecoratorWithCtor_IsRequired([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                       FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            configuration.IsRequired(false);

            Assert.True(constructorParameterInfo.IsRequired.HasValue);
            Assert.False(constructorParameterInfo.IsRequired.GetValueOrDefault(true));
        }
コード例 #5
0
        public void FluentDecoratorWithCtor_Use([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            constructorParameterInfo.UseType = null;

            configuration.Use(typeof(int));

            Assert.Equal(typeof(int), constructorParameterInfo.UseType);
        }
コード例 #6
0
        public void FluentDecoratorWithCtor_Consider([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                     FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            ActivationStrategyFilter filter = strategy => true;

            configuration.Consider(filter);

            Assert.Same(filter, constructorParameterInfo.ExportStrategyFilter);
        }