Example #1
0
        public void RunGoesOverAllDirectoryTest()
        {
            RecognitionRunner runner = new RecognitionRunner("data", this.recogniser);

            runner.Run();
            recogniser.ReceivedWithAnyArgs(8).RecogniseCustom("");
            recogniser.ReceivedWithAnyArgs(8).RecogniseDefault("");
        }
Example #2
0
        public void RunOutputsValidNamesTest()
        {
            RecognitionRunner runner = new RecognitionRunner("data", this.recogniser);

            runner.Run();
            DirectoryInfo dataDI = new DirectoryInfo("data");

            foreach (DirectoryInfo di in dataDI.EnumerateDirectories().ToList())
            {
                Assert.IsTrue(di.Exists);
                string[] fileNames = di.EnumerateFiles().Select((FileInfo fi) => fi.Name).ToArray();
                Assert.IsTrue(fileNames.Contains("1introduction.txt"));
            }
        }
Example #3
0
        public void RunOutputsTextFileTest()
        {
            RecognitionRunner runner = new RecognitionRunner("data", this.recogniser);

            runner.Run();
            DirectoryInfo dataDI = new DirectoryInfo("data");

            Assert.AreNotEqual(0, dataDI.EnumerateDirectories().Count());
            foreach (DirectoryInfo di in dataDI.EnumerateDirectories().ToList())
            {
                Assert.IsTrue(di.Exists);
                Assert.AreNotEqual(di.EnumerateFiles().Count(), 0);
                string simpleResult = File.ReadAllText(di.EnumerateFiles().First().FullName);
                Assert.AreNotEqual(simpleResult.Count(), 0);
            }
        }