public void ShouldCreateFloatColumn(
            [Values("somefloat")]
            string name,

            [Values(7, null)]
            int?precision,

            [Values(4, null)]
            int?scale,

            [Values(Nullable.Null, Nullable.NotNull, Nullable.Sparse)]
            Nullable nullable,

            [Values("2.9999999999999")]
            string defaultExpression,

            [Values("default constraint name")]
            string defaultConstraintName,

            [Values("float column", null)]
            string description)
        {
            PrecisionScale size = null;

            if (precision == null && scale == null)
            {
            }
            else if (precision != null && scale == null)
            {
                size = new PrecisionScale(precision.Value);
            }
            else if (precision != null)
            {
                size = new PrecisionScale(precision.Value, scale.Value);
            }

            GivenColumn(Column.Float(name, size, nullable, defaultExpression, defaultConstraintName, description));
            ThenColumnShouldBe(name, DataType.Float, size, nullable, defaultExpression, defaultConstraintName, description);
        }
Ejemplo n.º 2
0
        public void ShouldCreateExpressionWhenOnlyPrecisionGiven()
        {
            var size = new PrecisionScale(3);

            Assert.That(size.ToString(), Is.EqualTo("(3)"));
        }
Ejemplo n.º 3
0
        public void ShouldCreateExpressionWhenPrecisionAndScaleGiven()
        {
            var size = new PrecisionScale(4, 2);

            Assert.That(size.ToString(), Is.EqualTo("(4,2)"));
        }