Exemplo n.º 1
0
        public void ShouldTestStep()
        {
            var gen         = new RandomDateTimeGenerator(new ColumnDataTypeDefinition("DateTime2(2)", false));
            var firstValue  = gen.GenerateValue(1);
            var secondValue = gen.GenerateValue(2);

            Assert.That(firstValue, Is.Not.EqualTo(secondValue));
        }
Exemplo n.º 2
0
        public void ShouldGenerateValue()
        {
            var gen        = new RandomDateTimeGenerator(new ColumnDataTypeDefinition("DateTime2(2)", false));
            var firstValue = gen.GenerateValue(1);

            Assert.That(firstValue, Is.Not.Null);
        }
Exemplo n.º 3
0
        public void ShouldTestMinAndMaxLimits()
        {
            var gen     = new RandomDateTimeGenerator(new ColumnDataTypeDefinition("DateTime2(2)", false));
            var minDate = new DateTime(2010, 4, 1);
            var maxDate = new DateTime(2015, 12, 31);

            gen.GeneratorParameters.MinDate.Value = minDate;
            gen.GeneratorParameters.MaxDate.Value = maxDate;

            // Strange test since it is random
            for (long n = 0; n < 100; n++)
            {
                var val = gen.GenerateValue(n);
                Assert.That(val, Is.GreaterThan(minDate));
                Assert.That(val, Is.LessThan(maxDate));
            }
        }