Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            // Executes the console crawler application.
            var consoleApp = ConsoleCrawlerAppFactory.Create();

            consoleApp.Run(args);
        }
Exemplo n.º 2
0
        public void When_ArgumentsAreOK_Then_CrawlAndSaveFile()
        {
            // Arrange
            var domain   = "https://buildit.wiprodigital.com/";
            var filePath = "test.txt";
            var args     = new string[] { domain, filePath, "false" };
            var target   = ConsoleCrawlerAppFactory.Create();

            System.IO.File.Delete(filePath);

            // Act
            target.Run(args);

            // Assert
            var fileExists = System.IO.File.Exists(filePath);
            var firstLine  = System.IO.File.ReadAllLines(filePath)[0];

            Assert.IsTrue(fileExists);
            Assert.AreEqual(domain, firstLine);
        }