コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        public void Translate_GivenNullTemplateBuilder_ThrowsArgumentNullException()
        {
            var sut = new MarkupSpanTranslator();

            sut.Translate(new Span(new SpanBuilder()), null);
        }
コード例 #5
0
        public void Translate_GivenNullSpan_ThrowsArgumentNullException()
        {
            var sut = new MarkupSpanTranslator();

            sut.Translate(null, this._templateBuilder.Object);
        }