コード例 #1
0
        private IEnumerable <IConvention> ProvideNamedConventions(IFixtureConfiguration configuration)
        {
            var dataGenerator = configuration.Locate <IRandomDataGeneratorService>();
            var helper        = configuration.Locate <IConstraintHelper>();

            yield return(new StringNamedConvention(dataGenerator, helper));
        }
コード例 #2
0
        private IEnumerable <IConvention> ProvideDefaultConventions(IFixtureConfiguration configuration)
        {
            var dataGenerator = configuration.Locate <IRandomDataGeneratorService>();
            var helper        = configuration.Locate <IConstraintHelper>();

            yield return(new BoolConvention(dataGenerator));

            yield return(new ByteConvention(dataGenerator, helper));

            yield return(new CharConvention(dataGenerator, helper));

            yield return(new DateTimeConvention(dataGenerator, helper));

            yield return(new DecimalConvention(dataGenerator, helper));

            yield return(new DelegateConvention(helper));

            yield return(new DoubleConvention(dataGenerator, helper));

            yield return(new EnumConvention(dataGenerator, helper));

            yield return(new IntConvention(dataGenerator, helper));

            yield return(new LongConvention(dataGenerator, helper));

            yield return(new SByteConvention(dataGenerator, helper));

            yield return(new ShortConvention(dataGenerator, helper));

            yield return(new StringConvention(dataGenerator, helper));

            yield return(new TimeSpanConvention(dataGenerator, helper));

            yield return(new TypeConvention(dataGenerator));

            yield return(new UIntConvention(dataGenerator, helper));

            yield return(new ULongConvention(dataGenerator, helper));

            yield return(new UriConvention(helper));

            yield return(new UShortConvention(dataGenerator, helper));

            yield return(new ComplexConvention(configuration));

            yield return(new ArrayConvention());

            yield return(new DictionaryConvention());

            yield return(new ListConvention(configuration));

            yield return(new ReadOnlyCollectionConvention());

            yield return(new IComparerConvention());

            yield return(new IEqualityComparerConvention());

            yield return(new NullableConvention());
        }
コード例 #3
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="configuration"></param>
 public ComplexConvention(IFixtureConfiguration configuration)
 {
     _configuration            = configuration;
     _typeCreator              = configuration.Locate <ITypeCreator>();
     _typePopulator            = configuration.Locate <ITypePopulator>();
     _circularReferenceHandler = configuration.Locate <ICircularReferenceHandler>();
     _modelService             = configuration.Locate <IModelService>();
 }
コード例 #4
0
 public TypePopulator(IFixtureConfiguration configuration,
                      IConstraintHelper helper,
                      ITypePropertySelector propertySelector,
                      IPropertySetter setter,
                      ITypeFieldSelector fieldSelector,
                      IFieldSetter fieldSetter)
 {
     _configuration    = configuration;
     _helper           = helper;
     _propertySelector = propertySelector;
     _setter           = setter;
     _fieldSelector    = fieldSelector;
     _fieldSetter      = fieldSetter;
 }
コード例 #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="configuration"></param>
        public Fixture(IFixtureConfiguration configuration = null)
        {
            _configuration = configuration ?? new DefaultFixtureConfiguration();

            _conventions = _configuration.Locate <IConventionList>();

            _behavior = new BehaviorCollection();

            _returnConventions = new TypedConventions(Configuration, ConventionPriority.First);

            _typedConventions = new TypedConventions(Configuration);

            Initalize();
        }
コード例 #6
0
        public IEnumerable <IConvention> ProvideConventions(IFixtureConfiguration configuration)
        {
            var conventions = new List <IConvention>();

            if (configuration.UseDefaultConventions)
            {
                conventions.AddRange(ProvideDefaultConventions(configuration));
            }

            if (configuration.UseNamedConventions)
            {
                conventions.AddRange(ProvideNamedConventions(configuration));
            }

            return(conventions);
        }
コード例 #7
0
ファイル: Db4oSolo.cs プロジェクト: Galigator/db4o
		public Db4oSolo(IFixtureConfiguration fixtureConfiguration)
		{
			FixtureConfiguration(fixtureConfiguration);
		}
コード例 #8
0
ファイル: Db4oInMemory.cs プロジェクト: erdincay/db4o
		public Db4oInMemory(IFixtureConfiguration fc) : this()
		{
			FixtureConfiguration(fc);
		}
コード例 #9
0
 public Db4oInMemory(IFixtureConfiguration fc) : this()
 {
     FixtureConfiguration(fc);
 }
コード例 #10
0
ファイル: Db4oSolo.cs プロジェクト: dan-laskowski/OBD_Projekt
 public Db4oSolo(IFixtureConfiguration fixtureConfiguration)
 {
     FixtureConfiguration(fixtureConfiguration);
 }
コード例 #11
0
 void IDb4oFixture.FixtureConfiguration(IFixtureConfiguration configuration)
 {
     throw new NotImplementedException();
 }
コード例 #12
0
ファイル: AbstractDb4oFixture.cs プロジェクト: masroore/db4o
 public virtual void FixtureConfiguration(IFixtureConfiguration fc)
 {
     _fixtureConfiguration = fc;
 }
コード例 #13
0
 public virtual void FixtureConfiguration(IFixtureConfiguration fc)
 {
     _fixtureConfiguration = fc;
 }
コード例 #14
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="defaultSingleton"></param>
 public SubFixture(IFixtureConfiguration configuration = null, bool defaultSingleton = true)
     : base(configuration)
 {
     Add(new SubstituteConvention(defaultSingleton));
 }
コード例 #15
0
 public TypePropertySelector(IFixtureConfiguration configuration, IConstraintHelper helper)
 {
     _configuration = configuration;
     _helper        = helper;
 }
コード例 #16
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="priority"></param>
 public TypedConventions(IFixtureConfiguration configuration, ConventionPriority priority = ConventionPriority.High)
 {
     _configuration = configuration;
     Priority       = priority;
 }
コード例 #17
0
 public FakeFixture(IFixtureConfiguration configuration = null, bool defaultSingleton = true) : base(configuration)
 {
     Add(new FakeConvention(defaultSingleton));
 }
コード例 #18
0
 public TypeCreator(IFixtureConfiguration configuration, IConstructorSelector selector, IConstraintHelper constraintHelper)
 {
     _configuration    = configuration;
     _selector         = selector;
     _constraintHelper = constraintHelper;
 }
コード例 #19
0
		void IDb4oFixture.FixtureConfiguration(IFixtureConfiguration configuration)
		{
			throw new NotImplementedException();
		}
コード例 #20
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="configuration"></param>
 public ListConvention(IFixtureConfiguration configuration)
 {
     _configuration = configuration;
 }