public void IsFilePathValid_Returns_False_If_NullOrWhiteSpace()
        {
            var validFilePathChecker = new ValidSaveFilePathChecker();

            Assert.False(validFilePathChecker.IsFilePathValid(null));
            Assert.False(validFilePathChecker.IsFilePathValid(string.Empty));
            Assert.False(validFilePathChecker.IsFilePathValid(" "));
        }
        public void IsFilePathValid_Returns_True_If_Containing_Directory_Exists()
        {
            var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            Assert.True(Directory.Exists(appDataPath));

            var testPath = Path.Combine(appDataPath, "Test.csv");

            var validFilePathChecker = new ValidSaveFilePathChecker();

            Assert.True(validFilePathChecker.IsFilePathValid(testPath));
        }
        public void IsFilePathValid_Returns_False_If_Containing_Directory_Does_Not_Exist()
        {
            const string NonExistentDirectory = @"C:\ThisDirectoryAlmostCertainlyDoesNotExist";

            Assert.False(Directory.Exists(NonExistentDirectory));

            var testPath = Path.Combine(NonExistentDirectory, "Test.csv");

            var validFilePathChecker = new ValidSaveFilePathChecker();

            Assert.False(validFilePathChecker.IsFilePathValid(testPath));
        }
        public void IsFilePathValid_Returns_True_If_Predicate_Passes_And_Directory_Exists()
        {
            // This should always exist
            var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            Assert.True(Directory.Exists(appDataPath));

            var testPath = Path.Combine(appDataPath, "Test.csv");

            var validFilePathChecker = new ValidSaveFilePathChecker();

            Assert.True(validFilePathChecker.IsFilePathValid(testPath, p => p.EndsWith(".csv", StringComparison.OrdinalIgnoreCase)));
        }