public void WhenLocalDirectoryPathIsTooLongValidationResultIsError()
        {
            // Prepare
            int            maxPathLength           = 20;
            IConfiguration configuration           = MockFactory.ConfigurationWithMaximumPathLengthOf(maxPathLength);
            MaximumPathLengthValidation validation = new MaximumPathLengthValidation(configuration);
            string         tooLongPath             = "C:/asdfasdf/asdfasdf/asdfasdf";
            IDirectoryInfo directory = MockFactory.DirectoryWithPath(tooLongPath);

            // Exercise
            IValidationResult validationResult = validation.Validate(directory);

            // Verify
            AssertExtension.ValidationResultIsError(validationResult, "Directory with too long path does not trigger an error.");
        }
Example #2
0
        public void WhenLocalDirectoryTreeDepthIsEqualToMaxDepthValidationResultIsSuccess()
        {
            // Prepare
            int                        maxDepth      = 4;
            IConfiguration             configuration = MockFactory.ConfigurationWithMaximumDepthOf(maxDepth);
            MaximumTreeDepthValidation validation    = new MaximumTreeDepthValidation(configuration);
            var                        path          = Path.Combine(@"C:\", "first", "second", "third", "fourth");
            IDirectoryInfo             directory     = MockFactory.DirectoryWithPath(path);

            // Exercise
            IValidationResult validationResult = validation.Validate(directory);

            // Verify
            AssertExtension.ValidationResultIsSuccess(validationResult, "Local file with depth equal to max depth triggers an error.");
        }