public void WhenFileConvertedThenHtmlIsOk()
        {
            var converter = new UnicodeFileToHtmTextConverter("../../Data/UnicodeToHtml.txt");

            var html = converter.ConvertToHtml();

            Assert.AreEqual("This is a sample<br />unicode file<br />With &#233; &#224; &amp;<br />", html);
        }
        public void WhenInvalidFileThenThrowException()
        {
            var converter       = new UnicodeFileToHtmTextConverter("../../Data/UnexistingFile.txt");
            var exceptionRaised = false;

            try
            {
                var html = converter.ConvertToHtml();
            }
            catch (FileNotFoundException ex)
            {
                exceptionRaised = true;
            }

            Assert.IsTrue(exceptionRaised);
        }
        public void TestMethod()
        {
            MockRepository mocks = new MockRepository();
            TextReader reader = mocks.StrictMock<TextReader>();

            Expect.Call(reader.ReadLine()).Return("hello привет");
            Expect.Call(reader.ReadLine()).Return(null);

            mocks.ReplayAll();

            UnicodeFileToHtmTextConverter unicode = new UnicodeFileToHtmTextConverter(reader);

            Assert.AreEqual("hello привет</b>",unicode.ConvertToHtml());

            mocks.VerifyAll();
        }
Exemplo n.º 4
0
        public void foobar()
        {
            UnicodeFileToHtmTextConverter converter = new UnicodeFileToHtmTextConverter("foobar.txt");

            Assert.AreEqual("fixme", converter.GetFilename());
        }
 public void foobar()
 {
     UnicodeFileToHtmTextConverter converter = new UnicodeFileToHtmTextConverter("foobar.txt");
     Assert.AreEqual("fixme", converter.GetFilename());
 }
        public void WhenInitializedThenInstanceSetedUp()
        {
            var converter = new UnicodeFileToHtmTextConverter("../../Data/UnicodeToHtml.txt");

            Assert.IsNotNull(converter);
        }