Example #1
0
        public void TryParseSuffix_should_split_suffix_before_last_dash()
        {
            timeSuffixFormatter.TryParseSuffix("1-2-3-4").Returns(default(DateTime));
            sizeSuffixFormatter.TryParseSuffix("5").Returns(5);

            suffixFormatter.TryParseSuffix("1-2-3-4-5").Should().Be((default(DateTime), 5));
        }
Example #2
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);
        }
Example #3
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?);
        }