public DefaultPrintContextFactory( Logger logger, VariableFormatter variableFormatter, IEnumerable<Formatter> formatters) { logger.Debug(string.Format("using default formatter: {0}", variableFormatter.GetType().Name)); logger.Debug(string.Format("using other formatters: {0}", string.Join(", ", formatters .Select(f => f.GetType().Name) .ToArray()))); this.variableFormatter = variableFormatter; this.formatters = formatters; }
public PrintContextImpl(NameEnumeratorFactory nameEnumeratorFac, StringBuilder builder, CalledMethodInfo info, VariableFormatter variableFormatter, IEnumerable<Formatter> customFormatters, string subjectName, string serializerVarName, int spaceIndentation, string[] writtenVars) { if (nameEnumeratorFac == null) throw new ArgumentNullException("nameEnumeratorFac"); SpaceIndentation = spaceIndentation; Builder = builder; Info = info; SubjectName = subjectName; VariableFormatter = variableFormatter; WrittenVars = writtenVars; this.customFormatters = new LinkedList<Formatter>(customFormatters); SerializerName = serializerVarName; this.nameEnumeratorFac = nameEnumeratorFac; }
public DefaultPrintContextFactory( Logger logger, VariableFormatter variableFormatter, IEnumerable <Formatter> formatters) { logger.Debug(string.Format("using default formatter: {0}", variableFormatter.GetType().Name)); logger.Debug(string.Format("using other formatters: {0}", string.Join(", ", formatters .Select(f => f.GetType().Name) .ToArray()))); this.variableFormatter = variableFormatter; this.formatters = formatters; }
public PrintContextImpl(NameEnumeratorFactory nameEnumeratorFac, StringBuilder builder, CalledMethodInfo info, VariableFormatter variableFormatter, IEnumerable <Formatter> customFormatters, string subjectName, string serializerVarName, int spaceIndentation, string[] writtenVars) { if (nameEnumeratorFac == null) { throw new ArgumentNullException("nameEnumeratorFac"); } SpaceIndentation = spaceIndentation; Builder = builder; Info = info; SubjectName = subjectName; VariableFormatter = variableFormatter; WrittenVars = writtenVars; this.customFormatters = new LinkedList <Formatter>(customFormatters); SerializerName = serializerVarName; this.nameEnumeratorFac = nameEnumeratorFac; }
/// <summary> /// Initializes a new instance of the <see cref="VariableFormatterTests" /> class. /// </summary> public VariableFormatterTests() { this.formatterMock = new Mock <IMessageFormatter>(); this.subject = new VariableFormatter(); }