Ejemplo n.º 1
0
        public void Test004_CheckDuplicatesOnFriends()
        {
            contentFilter = new ContentFilter();

            var friendss05e14 = new PXDocument(DataFile("FRIENDS_05x14.srt"));
            var testDoc       = new PXDocument(TmpFile("FRIENDS_05x14_result.txt"));

            project = new Splitter(contentFilter);

            var r = project.Process(friendss05e14.ReadAllText(), new Processor());

            Assert.AreEqual(1, r.Where(i => i == "you").Count());
        }
Ejemplo n.º 2
0
        public void Test001_Write_CheckAFileIsWrittenAndClearIt()
        {
            var l = new List <string>()
            {
                "blabla", "chiasse"
            };
            var fileWriter = new FileWriter(new PXStreamWriterFactory());
            var testDoc    = new PXDocument(TmpFile("test.txt"));

            //Write
            fileWriter.Write(testDoc.Path, l);
            Assert.AreEqual(PathType.File, testDoc.Type);
            Assert.AreEqual(l, File.ReadAllLines(testDoc.Path));
            Assert.AreEqual("blabla\r\nchiasse\r\n", testDoc.ReadAllText());

            //Clear
            testDoc.Clear();
            Assert.AreEqual("", File.ReadAllLines(testDoc.Path));
        }