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

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

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

            strategyConfiguration.Received().When.InjectedInto <BasicService>();
        }
Example #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));
        }
Example #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);
        }
Example #6
0
        public void FluentDecoratorWithCtor_Consider([Freeze] ConstructorParameterInfo constructorParameterInfo,
                                                     FluentDecoratorWithCtorConfiguration <int> configuration)
        {
            ActivationStrategyFilter filter = strategy => true;

            configuration.Consider(filter);

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