StatePrinting.Configurations.Configuration.SetCulture C# (CSharp) Méthode

SetCulture() public méthode

Set the definition of the newline. The default configuration is a Environment.NewLine
public SetCulture ( CultureInfo culture ) : Configuration
culture System.Globalization.CultureInfo
Résultat Configuration
        public Configuration SetCulture(CultureInfo culture)
        {
            if (culture == null)
                throw new ArgumentNullException("culture");
            Culture = culture;

            return this;
        }

Usage Example

        public void SettingNullValues()
        {
            var sut = new Configuration();
            Assert.Throws<ArgumentNullException>(() => sut.SetCulture(null));
            Assert.Throws<ArgumentNullException>(() => sut.SetIndentIncrement(null));
            Assert.Throws<ArgumentNullException>(() => sut.SetNewlineDefinition(null));
            Assert.Throws<ArgumentNullException>(() => sut.SetOutputFormatter(null));
            Assert.Throws<ArgumentNullException>(() => sut.SetAreEqualsMethod(null));

            Assert.Throws<ArgumentNullException>(() => sut.Add((IFieldHarvester)null));
            Assert.Throws<ArgumentNullException>(() => sut.Add((IValueConverter)null));

            Assert.Throws<ArgumentNullException>(() => sut.Test.SetAreEqualsMethod(null));
            Assert.Throws<ArgumentNullException>(() => sut.Test.SetAutomaticTestRewrite(null));
        }