public void Translate_GivenTextWithDoubleQuotes_CallsTemplateBuilderQuoted_DoubleQuotesEscaped() { var sut = new MarkupSpanTranslator(); string input = "Hello \"Martin\"!"; Span span = SpanHelper.BuildSpan(input); sut.Translate(span, this._templateBuilder.Object); this._templateBuilder.Verify(t => t.Write(input.Replace("\"", "\\\""), true)); }
public void Translate_GivenText_CallsTemplateBuilderQuoted() { var sut = new MarkupSpanTranslator(); string input = "Model"; Span span = SpanHelper.BuildSpan(input); sut.Translate(span, this._templateBuilder.Object); this._templateBuilder.Verify(t => t.Write(input, true)); }
public void Translate_GivenTextWithLineBreakEnd_CallsTemplateBuilderQuoted_LineBreakEscaped() { var sut = new MarkupSpanTranslator(); string input = "Hello \nMartin!"; Span span = SpanHelper.BuildSpan(input); sut.Translate(span, this._templateBuilder.Object); this._templateBuilder.Verify(t => t.Write(input.Replace("\n", "\\n"), true)); }
public void Translate_GivenNullTemplateBuilder_ThrowsArgumentNullException() { var sut = new MarkupSpanTranslator(); sut.Translate(new Span(new SpanBuilder()), null); }
public void Translate_GivenNullSpan_ThrowsArgumentNullException() { var sut = new MarkupSpanTranslator(); sut.Translate(null, this._templateBuilder.Object); }