Example #1
0
        public void Converter_Escapes_Quotes()
        {
            var lines         = new[] { "text with 'quotes'" };
            var accessWrapper = new FileAccessWrapperSpy(lines);

            var result = new HtmlPagesConverter(accessWrapper)
                         .ConvertToHtml();

            result.Should().Be("text with &quot;quotes&quot;<br />");
        }
Example #2
0
        public void Converter_Creates_LineBreaks()
        {
            var lines         = new[] { "plain text" };
            var accessWrapper = new FileAccessWrapperSpy(lines);

            var result = new HtmlPagesConverter(accessWrapper)
                         .ConvertToHtml();

            result.Should().Be("plain text<br />");
        }
Example #3
0
        public void Converter_CanConvert_EmptyFile()
        {
            var lines         = new string[0];
            var accessWrapper = new FileAccessWrapperSpy(lines);

            var result = new HtmlPagesConverter(accessWrapper)
                         .ConvertToHtml();

            result.Should().BeEmpty();
        }
Example #4
0
        public void UsingRealFileToTestConvertion()
        {
            var fileName = "aFile.txt";
            var file     = File.CreateText(fileName);

            file.WriteLine("plain text");
            file.Close();

            var testee = new HtmlPagesConverter(
                new FileSystemAccessWrapper(
                    fileName));
            var convertedText = testee.ConvertToHtml();

            convertedText.Should().Be("plain text<br />");
        }