Example #1
0
        public void Match_GivenNullSpan_ReturnsFalse()
        {
            var sut = new GenericCodeSpanTranslator();

            var result = sut.Match(null);

            Assert.IsFalse(result);
        }
Example #2
0
        public void Match_GivenCodeSpan_ReturnsTrue()
        {
            Span codeSpan = SpanHelper.BuildSpan("a", SpanKind.Code);

            var sut = new GenericCodeSpanTranslator();

            var result = sut.Match(codeSpan);

            Assert.IsTrue(result);
        }
Example #3
0
        public void Translate_CallsTemplateBuilder()
        {
            Mock <ITemplateBuilder> templateBuilder = new Mock <ITemplateBuilder>();
            string expected = "a";

            var sut = new GenericCodeSpanTranslator();

            sut.Translate(expected, templateBuilder.Object);

            templateBuilder.Verify(t => t.AddCodeBlock(expected));
        }
Example #4
0
        public void Translate_GivenNullTemplateBuilder_ThrowsArgumentNullException()
        {
            var sut = new GenericCodeSpanTranslator();

            sut.Translate("a", null);
        }
Example #5
0
        public void SupportedType_ReturnsGenericCodeStatement()
        {
            var sut = new GenericCodeSpanTranslator();

            Assert.AreEqual(StatementTypes.GenericCodeStatement, sut.SupportedType);
        }
Example #6
0
        public void ImplementsInterface()
        {
            var sut = new GenericCodeSpanTranslator();

            Assert.IsInstanceOfType(sut, typeof(ICodeSpanTranslator));
        }