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

            var result = config.IsUnicode(false);

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

            var result = config.IsUnicode(false);

            Assert.Equal(false, innerConfig.IsUnicode);
            Assert.Same(config, result);
        }
예제 #3
0
        public void IsUnicode_is_noop_when_set()
        {
            var innerConfig = new StringPropertyConfiguration
            {
                IsUnicode = false
            };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsUnicode();

            Assert.Equal(false, innerConfig.IsUnicode);
            Assert.Same(config, result);
        }
        public void IsUnicode_with_parameter_is_noop_when_not_string()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsUnicode(false);

            Assert.Same(config, result);
        }
        public void IsUnicode_with_parameter_is_noop_when_set()
        {
            var innerConfig = new StringPropertyConfiguration
                                  {
                                      IsUnicode = true
                                  };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsUnicode(false);

            Assert.Equal(true, innerConfig.IsUnicode);
            Assert.Same(config, result);
        }
        public void IsUnicode_configures_when_unset()
        {
            var innerConfig = new StringPropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsUnicode();

            Assert.Equal(true, innerConfig.IsUnicode);
            Assert.Same(config, result);
        }