Ejemplo n.º 1
0
        public void TestUnicodeFileToHtmlTextConverter()
        {
            string expectedResult = "test<br />";
            string testFilePath   = "C:\\Temp\\UnicodeFileToHtmlConverterTestFile.txt";
            var    htmlConvertor  = new UnicodeFileToHtmlTextConverter(testFilePath);
            string result         = htmlConvertor.ConvertToHtml();

            Assert.AreEqual(result, expectedResult);
        }
Ejemplo n.º 2
0
        public void EncodeTextReader()
        {
            // Arrange
            var converter = new UnicodeFileToHtmlTextConverter();
            var reader    = new StringReader(string.Format("a{0}bc{0}d", Environment.NewLine));

            // Act
            string encoded = converter.ConvertToHtml(reader);

            // Assert
            Assert.AreEqual("a<br />bc<br />d<br />", encoded);
        }
Ejemplo n.º 3
0
        public void EncodeOneLine()
        {
            // Arrange
            var    converter = new UnicodeFileToHtmlTextConverter();
            string line      = "blabla";

            // Act
            string encoded = converter.EncodeLine(line);

            // Assert
            Assert.AreEqual("blabla<br />", encoded);
        }
        // A class with the only goal of simulating a dependency on UnicodeFileToHtmTextConverter
        // that has impact on the refactoring.

        public aTextConverterClient1()
        {
            var filename      = "aFilename.txt";
            var textConverter = new UnicodeFileToHtmlTextConverter(filename);
            var html          = textConverter.ConvertToHtml();
        }
Ejemplo n.º 5
0
        public aTextConverterClient2()
        {
            _textConverter = new UnicodeFileToHtmlTextConverter("anotherFilename.txt");

            var html = _textConverter.ConvertToHtml();
        }