StatePrinting.Configurations.Configuration.SetOutputFormatter C# (CSharp) Method

SetOutputFormatter() public method

public SetOutputFormatter ( IOutputFormatter formatter ) : Configuration
formatter IOutputFormatter
return Configuration
        public Configuration SetOutputFormatter(IOutputFormatter formatter)
        {
            if (formatter == null)
                throw new ArgumentNullException("formatter");
            OutputFormatter = formatter;
            return this;
        }

Usage Example

Exemplo n.º 1
0
        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));
        }