Пример #1
0
        /**
         * This may seem counter-intuitive because it should work the OPPOSITE in production,
         * but since this loop is simulated it is actually a 'real' folder and should not be detected
         * as a loop with a high recursion limit
         */
        public void Execute_WithLoopAndHighRecursionLimit_WillNotFindLoop()
        {
            // Arrange
            ScanCommand command = new ScanCommand(@"c:/", 10, false, false);

            // Act
            command.Execute(testConsole, testFileSystem, testPathResolver);

            // Assert
            Assert.IsTrue(testConsole.GetHistory().Contains("no loops found", StringComparison.OrdinalIgnoreCase));
        }
Пример #2
0
        public void Execute_WithNonExistingRootFolder_WillPrintError()
        {
            // Arrange
            ScanCommand command = new ScanCommand(@"c:/doesnotexist", 5, false, false);

            // Act
            command.Execute(testConsole, testFileSystem, testPathResolver);

            // Assert
            Assert.IsTrue(testConsole.GetHistory().Contains("does not exist", StringComparison.OrdinalIgnoreCase));
        }
Пример #3
0
        public void Execute_WithNoLoops_WillFindNoLoops()
        {
            // Arrange
            ScanCommand command = new ScanCommand(@"c:/demo", 5, false, false);

            // Act
            command.Execute(testConsole, testFileSystem, testPathResolver);

            // Assert
            Assert.IsTrue(testConsole.GetHistory().Contains("no loops found", StringComparison.OrdinalIgnoreCase));
        }