コード例 #1
0
        public void ThrowWhenPrecisionIsSetToNonPositiveValue()
        {
            var type = new DecimalLogicalType(1, 0);

            Assert.Throws <ArgumentOutOfRangeException>(() => type.Precision = 0);
            Assert.Throws <ArgumentOutOfRangeException>(() => type.Precision = -1);
        }
コード例 #2
0
        public void SetPrecision()
        {
            var type = new DecimalLogicalType(1, 0);

            Assert.Equal(1, type.Precision);

            type.Precision = 2;
            Assert.Equal(2, type.Precision);
        }
コード例 #3
0
        public void SetScale()
        {
            var type = new DecimalLogicalType(1, 0);

            Assert.Equal(0, type.Scale);

            type.Scale = 1;
            Assert.Equal(1, type.Scale);
        }
コード例 #4
0
        public void ThrowWhenScaleIsSetToValueGreaterThanPrecision()
        {
            var type = new DecimalLogicalType(1, 0);

            Assert.Throws <ArgumentOutOfRangeException>(() => type.Scale = 2);
        }
コード例 #5
0
        public void ThrowWhenScaleIsSetToNegativeValue()
        {
            var type = new DecimalLogicalType(1, 0);

            Assert.Throws <ArgumentOutOfRangeException>(() => type.Scale = -1);
        }
コード例 #6
0
        public void ThrowWhenPrecisionIsSetToValueLessThanScale()
        {
            var type = new DecimalLogicalType(8, 4);

            Assert.Throws <ArgumentOutOfRangeException>(() => type.Precision = 2);
        }