コード例 #1
0
 public TimeBasedRollingStrategy(IFileSystem fileSystem, IFileSuffixFormatter <DateTime> suffixFormatter, Func <DateTime> timeProvider, Func <char> suffixSeparatorProvider)
 {
     this.suffixFormatter         = suffixFormatter;
     this.timeProvider            = timeProvider;
     this.fileSystem              = fileSystem;
     this.suffixSeparatorProvider = suffixSeparatorProvider;
 }
コード例 #2
0
        public void TestSetup()
        {
            timeSuffixFormatter = Substitute.For <IFileSuffixFormatter <DateTime> >();
            sizeSuffixFormatter = Substitute.For <IFileSuffixFormatter <int> >();

            suffixFormatter = new HybridSuffixFormatter(timeSuffixFormatter, sizeSuffixFormatter);
        }
コード例 #3
0
 public SizeBasedRollingStrategy(IFileSystem fileSystem, IFileSuffixFormatter <int> suffixFormatter, ISizeBasedRoller sizeBasedRoller, Func <char> suffixSeparatorProvider)
 {
     this.sizeBasedRoller         = sizeBasedRoller;
     this.fileSystem              = fileSystem;
     this.suffixFormatter         = suffixFormatter;
     this.suffixSeparatorProvider = suffixSeparatorProvider;
 }
コード例 #4
0
        public void TestSetup()
        {
            fileSystem = Substitute.For <IFileSystem>();
            fileSystem.GetFilesByPrefix("logs/log.txt").Returns(new FilePath[] { "logs/log1.txt" });

            suffixFormatter = Substitute.For <IFileSuffixFormatter <int> >();
            suffixFormatter.TryParseSuffix(Arg.Any <string>()).Returns(info => int.TryParse(info.Arg <string>(), out var value) ? value : null as int?);
        }
コード例 #5
0
        public void TestSetup()
        {
            fileSystem = Substitute.For <IFileSystem>();
            fileSystem.GetFilesByPrefix("logs/log.txt").Returns(new FilePath[] { "logs/log1.txt" });

            suffixFormatter = Substitute.For <IFileSuffixFormatter <int> >();
            suffixFormatter.TryParseSuffix("1").Returns(1);
            suffixFormatter.TryParseSuffix("2").Returns(2);
            suffixFormatter.TryParseSuffix("3").Returns(3);
        }
コード例 #6
0
 public SizeBasedRollingStrategy(IFileSystem fileSystem, IFileSuffixFormatter <int> suffixFormatter, ISizeBasedRoller sizeBasedRoller)
 {
     this.sizeBasedRoller = sizeBasedRoller;
     this.fileSystem      = fileSystem;
     this.suffixFormatter = suffixFormatter;
 }