예제 #1
0
        public void HasPrecision_with_scale_is_noop_when_not_decimal()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config      = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(8, 2);

            Assert.Same(config, result);
        }
예제 #2
0
        public void HasPrecision_configures_when_unset()
        {
            var innerConfig = new DateTimePropertyConfiguration();
            var config      = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(8);

            Assert.Equal <byte?>(8, innerConfig.Precision);
            Assert.Same(config, result);
        }
예제 #3
0
        public void HasPrecision_with_scale_configures_when_unset()
        {
            var innerConfig = new DecimalPropertyConfiguration();
            var config      = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(8, 2);

            Assert.Equal <byte?>(8, innerConfig.Precision);
            Assert.Equal <byte?>(2, innerConfig.Scale);
            Assert.Same(config, result);
        }
예제 #4
0
        public void HasPrecision_with_scale_is_noop_when_scale_set()
        {
            var innerConfig = new DecimalPropertyConfiguration
            {
                Scale = 2
            };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(7, 1);

            Assert.Null(innerConfig.Precision);
            Assert.Equal <byte?>(2, innerConfig.Scale);
            Assert.Same(config, result);
        }
        public void HasPrecision_with_scale_is_noop_when_not_decimal()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(8, 2);

            Assert.Same(config, result);
        }
        public void HasPrecision_with_scale_is_noop_when_scale_set()
        {
            var innerConfig = new DecimalPropertyConfiguration
                                  {
                                      Scale = 2
                                  };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(7, 1);

            Assert.Null(innerConfig.Precision);
            Assert.Equal<byte?>(2, innerConfig.Scale);
            Assert.Same(config, result);
        }
        public void HasPrecision_with_scale_configures_when_unset()
        {
            var innerConfig = new DecimalPropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(8, 2);

            Assert.Equal<byte?>(8, innerConfig.Precision);
            Assert.Equal<byte?>(2, innerConfig.Scale);
            Assert.Same(config, result);
        }
        public void HasPrecision_is_noop_when_set()
        {
            var innerConfig = new DateTimePropertyConfiguration
                                  {
                                      Precision = 8
                                  };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasPrecision(7);

            Assert.Equal<byte?>(8, innerConfig.Precision);
            Assert.Same(config, result);
        }