Exemple #1
0
        private void PopulateOtherLogFileNameParts()
        {
            log.Debug("PopulateOtherLogFileNameParts()");
            this.BaseLogFileName      = GetBaseLogFileName(this.LogFileName);
            this.AllLogPartsFileNames = LogPartsFileNameFinder.GetFileNameParts(this.BaseLogFileName);

            log.Debug("PopulateOtherLogFileNameParts() done.");
        }
        public void SecondStrategySecondStrategyShouldBeUsedWhenMatchingFilesExist()
        {
            var fileNames = new[] { this.BaseName.Replace(".log", ".1.log"), this.BaseName.Replace(".log", ".2.log"), this.BaseName.Replace(".log", ".3.log") };

            foreach (var fn in fileNames)
            {
                File.WriteAllText(fn, fn);
            }

            var parts = LogPartsFileNameFinder.GetFileNameParts(fileNames[0]);

            foreach (var fn in fileNames)
            {
                Assert.Contains(fn, (ICollection)parts);
            }
        }
        public void FirstStrategySecondStrategyShouldBeUsedWhenMatchingFilesExist()
        {
            var fileNames = new[] { BaseName, BaseName + ".1", BaseName + ".2" };

            foreach (var fn in fileNames)
            {
                File.WriteAllText(fn, fn);
            }

            var parts = LogPartsFileNameFinder.GetFileNameParts(fileNames[0]);

            foreach (var fn in fileNames)
            {
                Assert.Contains(fn, (ICollection)parts);
            }
        }