/// <summary> /// Initializes a new instance of the <see cref="FluentMessage"/> class. /// </summary> /// <param name="message"> /// The main message. /// </param> /// <remarks> /// You can use {x} as place holders for standard wordings: /// - {0}. /// </remarks> private FluentMessage(string message) { this.message = message ?? throw new ArgumentNullException(nameof(message)); this.entity = null; this.checkedNamer = new EntityNamer(); this.expectedNamer = new EntityNamer(); this.checkedLabel = GenericLabelBlock.BuildCheckedBlock(this.checkedNamer); this.expectedLabel = GenericLabelBlock.BuildExpectedBlock(this.expectedNamer); }
/// <summary> /// Initializes a new instance of the <see cref="FluentMessage"/> class. /// </summary> /// <param name="message"> /// The main message. /// </param> /// <remarks> /// You can use {x} as place holders for standard wordings: /// - {0}. /// </remarks> private FluentMessage(string message) { this.message = message; this.EntityDescription = null; this.checkedNamer = new EntityNamer(); this.expectedNamer = new EntityNamer(); this.checkedLabel = GenericLabelBlock.BuildCheckedBlock(this.checkedNamer); this.expectedLabel = GenericLabelBlock.BuildExpectedBlock(this.expectedNamer); }
/// <summary> /// Initializes a new instance of the <see cref="FluentMessage"/> class. /// </summary> /// <param name="message"> /// The main message. /// </param> /// <remarks> /// You can use {x} as place holders for standard wordings: /// - {0}. /// </remarks> private FluentMessage(string message) { var format = message; format = format.Replace("{checked}", "{0}"); format = format.Replace("{expected}", "{1}"); format = format.Replace("{given}", "{1}"); this.message = format; this.dontRepeatExpected = NormalOrder.IsMatch(format); this.dontRepeatChecked = ReverseOrder.IsMatch(format); this.checkedNamingLogic = new EntityNamingLogic(); this.expectedNamingLogic = new EntityNamingLogic(); this.checkedLabel = GenericLabelBlock.BuildCheckedBlock(this.checkedNamingLogic); this.expectedLabel = GenericLabelBlock.BuildExpectedBlock(this.expectedNamingLogic); }