Пример #1
0
        public void MatchLengthStartWithUncPatternEmptyString()
        {
            string winDirectory  = string.Format("", _directoryStart);
            string unixDirectory = string.Format("", _altDirectoryStart);

            FileUtilitiesRegex.StartsWithUncPatternMatchLength(winDirectory).ShouldBe(-1);
            FileUtilitiesRegex.StartsWithUncPatternMatchLength(unixDirectory).ShouldBe(-1);
        }
Пример #2
0
        public void MatchLengthStartWithUncPatternExactDirectory()
        {
            string winDirectory  = string.Format("{0}server\\path", _directoryStart);
            string unixDirectory = string.Format("{0}server/path", _altDirectoryStart);

            FileUtilitiesRegex.StartsWithUncPatternMatchLength(winDirectory).ShouldBe(13);
            FileUtilitiesRegex.StartsWithUncPatternMatchLength(unixDirectory).ShouldBe(13);
        }
Пример #3
0
        public void MatchLengthStartWithUncPatternTrailingSlash()
        {
            string winDirectory  = string.Format("{0}abc\\def\\", _directoryStart);
            string unixDirectory = string.Format("{0}abc/def/", _altDirectoryStart);

            FileUtilitiesRegex.StartsWithUncPatternMatchLength(winDirectory).ShouldBe(9);
            FileUtilitiesRegex.StartsWithUncPatternMatchLength(unixDirectory).ShouldBe(9);
        }
Пример #4
0
 public void PatternEmptyString()
 {
     FileUtilitiesRegex.IsUncPattern(string.Empty).ShouldBeFalse();
     FileUtilitiesRegex.StartsWithUncPattern(string.Empty).ShouldBeFalse();
     FileUtilitiesRegex.StartsWithUncPatternMatchLength(string.Empty).ShouldBe(-1);
 }