public void CtorShouldSetValues()
        {
            var values   = new List <object>();
            var metaData = new DefaultDatapoolMetadata <object>(values, true, 0, DatapoolThreadDistributionMode.ThreadShared, false);

            Assert.That(metaData.Values == values);
        }
        private static DefaultDatapoolMetadata <TestValues> CreateDatapoolMetadata()
        {
            var values = new List <TestValues> {
                new TestValues {
                    IntValue = 1
                }
            };
            var datapoolMetatdata = new DefaultDatapoolMetadata <TestValues>(values, false, 0, DatapoolThreadDistributionMode.ThreadShared, true);

            return(datapoolMetatdata);
        }
Beispiel #3
0
        public void CreateDatapool <T>(IDatapoolValuesFactory <T> datapoolValuesFactory, string name) where T : class
        {
            if (datapoolValuesFactory == null)
            {
                throw new ArgumentNullException("datapoolValuesFactory");
            }

            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException("name");
            }

            IList <T> values            = datapoolValuesFactory.CreateValues(GrinderContext, name);
            bool      isRandom          = bool.Parse(GrinderContext.GetProperty(GetPropertyKey(name, "random"), bool.FalseString));
            int       seed              = int.Parse(GrinderContext.GetProperty(GetPropertyKey(name, "seed"), ((int)DateTime.Now.Ticks).ToString()));
            var       distributionMode  = (DatapoolThreadDistributionMode)Enum.Parse(typeof(DatapoolThreadDistributionMode), GrinderContext.GetProperty(GetPropertyKey(name, "distributionMode"), DatapoolThreadDistributionMode.ThreadShared.ToString()), false);
            bool      isCircular        = bool.Parse(GrinderContext.GetProperty(GetPropertyKey(name, "circular"), bool.TrueString));
            var       datapoolMetatdata = new DefaultDatapoolMetadata <T>(values, isRandom, seed, distributionMode, isCircular, name);

            CreateDatapool(datapoolMetatdata);
        }
 public void CtorShouldSetIsSircular()
 {
     var metaData = new DefaultDatapoolMetadata<object>(new List<object>(), false, 0, DatapoolThreadDistributionMode.ThreadShared, true);
     Assert.That(metaData.IsCircular);
 }
 public void CtorShouldSetSeed()
 {
     var metaData = new DefaultDatapoolMetadata<object>(new List<object>(), false, 12, DatapoolThreadDistributionMode.ThreadShared, false);
     Assert.That(metaData.Seed == 12);
 }
 public void CtorShouldSetIsThreadUnique()
 {
     var metaData = new DefaultDatapoolMetadata<object>(new List<object>(), false, 0, DatapoolThreadDistributionMode.ThreadUnique, false);
     Assert.That(metaData.DistributionMode == DatapoolThreadDistributionMode.ThreadUnique);
 }
 public void CtorShouldUseTypeNameWhenNoNameIsPassedIn()
 {
     var metaData = new DefaultDatapoolMetadata<object>(new List<object>(), true, 0, DatapoolThreadDistributionMode.ThreadShared, false, " ");
     Assert.That(metaData.Name == "Object");
 }
 public void CtorShouldSetISRandom()
 {
     var metaData = new DefaultDatapoolMetadata<object>(new List<object>(), true, 0, DatapoolThreadDistributionMode.ThreadShared, false);
     Assert.That(metaData.IsRandom);
 }
 public void CtorShouldSetValues()
 {
     var values = new List<object>();
     var metaData = new DefaultDatapoolMetadata<object>(values, true, 0, DatapoolThreadDistributionMode.ThreadShared, false);
     Assert.That(metaData.Values == values);
 }
 public void CtorShouldUsePassedInName()
 {
     var metaData = new DefaultDatapoolMetadata<object>(new List<object>(), true, 0, DatapoolThreadDistributionMode.ThreadShared, false, "TestName");
     Assert.That(metaData.Name == "TestName");
 }
 private static DefaultDatapoolMetadata<TestValues> CreateDatapoolMetadata()
 {
     var values = new List<TestValues> { new TestValues { IntValue = 1 } };
     var datapoolMetatdata = new DefaultDatapoolMetadata<TestValues>(values, false, 0, DatapoolThreadDistributionMode.ThreadShared, true);
     return datapoolMetatdata;
 }
        public void CtorShouldUsePassedInName()
        {
            var metaData = new DefaultDatapoolMetadata <object>(new List <object>(), true, 0, DatapoolThreadDistributionMode.ThreadShared, false, "TestName");

            Assert.That(metaData.Name == "TestName");
        }
        public void CtorShouldSetIsSircular()
        {
            var metaData = new DefaultDatapoolMetadata <object>(new List <object>(), false, 0, DatapoolThreadDistributionMode.ThreadShared, true);

            Assert.That(metaData.IsCircular);
        }
        public void CtorShouldSetIsThreadUnique()
        {
            var metaData = new DefaultDatapoolMetadata <object>(new List <object>(), false, 0, DatapoolThreadDistributionMode.ThreadUnique, false);

            Assert.That(metaData.DistributionMode == DatapoolThreadDistributionMode.ThreadUnique);
        }
        public void CtorShouldSetSeed()
        {
            var metaData = new DefaultDatapoolMetadata <object>(new List <object>(), false, 12, DatapoolThreadDistributionMode.ThreadShared, false);

            Assert.That(metaData.Seed == 12);
        }
        public void CtorShouldSetISRandom()
        {
            var metaData = new DefaultDatapoolMetadata <object>(new List <object>(), true, 0, DatapoolThreadDistributionMode.ThreadShared, false);

            Assert.That(metaData.IsRandom);
        }
        public void CtorShouldUseTypeNameWhenNoNameIsPassedIn()
        {
            var metaData = new DefaultDatapoolMetadata <object>(new List <object>(), true, 0, DatapoolThreadDistributionMode.ThreadShared, false, " ");

            Assert.That(metaData.Name == "Object");
        }