Пример #1
0
        public void GetCollectionSize_ReturnsDefaultIfNoneDefined()
        {
            var defRange = new Range(10, 1000);

            _session = new BuildSession(new TestBuilder {
                CollectionSizes = _registry, DefaultCollectionSize = defRange
            }, null, _random);
            Assert.AreSame(defRange, _session.GetCollectionSize(typeof(string)));
        }
Пример #2
0
        public void GetCollectionSize_ReturnsDefinedRange()
        {
            var stringRange = new Range(-10, 1);
            var defRange    = new Range(10, 1000);

            _registry.SetForType <string>(stringRange);
            _session = new BuildSession(new TestBuilder {
                CollectionSizes = _registry, DefaultCollectionSize = defRange
            }, null, _random);

            Assert.AreSame(stringRange, _session.GetCollectionSize(typeof(string)));
        }
Пример #3
0
 public void SetUp()
 {
     _defaultRange = new Range(10, 1000);
     _registry     = new TypeRegistry <Range>();
     _random       = new Random(0);
 }