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; }
public void TestSetup() { timeSuffixFormatter = Substitute.For <IFileSuffixFormatter <DateTime> >(); sizeSuffixFormatter = Substitute.For <IFileSuffixFormatter <int> >(); suffixFormatter = new HybridSuffixFormatter(timeSuffixFormatter, sizeSuffixFormatter); }
public SizeBasedRollingStrategy(IFileSystem fileSystem, IFileSuffixFormatter <int> suffixFormatter, ISizeBasedRoller sizeBasedRoller, Func <char> suffixSeparatorProvider) { this.sizeBasedRoller = sizeBasedRoller; this.fileSystem = fileSystem; this.suffixFormatter = suffixFormatter; this.suffixSeparatorProvider = suffixSeparatorProvider; }
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?); }
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); }
public SizeBasedRollingStrategy(IFileSystem fileSystem, IFileSuffixFormatter <int> suffixFormatter, ISizeBasedRoller sizeBasedRoller) { this.sizeBasedRoller = sizeBasedRoller; this.fileSystem = fileSystem; this.suffixFormatter = suffixFormatter; }