Пример #1
0
        public void WhenShouldCreateInstanceWithProvidedParams()
        {
            var file = MockRepo.CreateFile();

            var newFile = file.With(new List <ISourceLine>
            {
                new SourceLine(1,
                               string.Empty,
                               Option <ILineCoverageStats> .None,
                               Option <ILineGitStats> .None)
            },
                                    new FileGitStats(1, 1),
                                    new FileCoverageStats(new FileCoverage(string.Empty,
                                                                           new List <(int lineNumber, int hitCount, bool
                                                                                      branch, string conditionCoverage)
                                                                                     >())));

            newFile.Content.Should()
            .HaveCount(1);
            newFile.GitStats.Match(x => x.LifetimeAuthors,
                                   () => 0)
            .Should()
            .Be(1);
            newFile.CoverageStats.Match(x => x.Coverage,
                                        () => default)
            .Should()
            .NotBeNull();
        }
Пример #2
0
        public void WhenCreatesANewFileObject()
        {
            var file = MockRepo.CreateFile();

            file.Should()
            .NotBeSameAs(file.With());
        }
Пример #3
0
        public void AsFileDetailsCreatesEquivalentFileDetailsObject()
        {
            var file        = MockRepo.CreateFile();
            var fileDetails = file.AsFileDetails();

            fileDetails.Content.Should()
            .BeEquivalentTo(file.Content);
            fileDetails.Extension.Should()
            .BeEquivalentTo(file.Extension);
            fileDetails.Filename.Should()
            .BeEquivalentTo(file.Filename);
            fileDetails.Path.Should()
            .BeEquivalentTo(file.Path);
            fileDetails.CoverageStats
            .Match(x => x.Coverage.FileName,
                   () => default)
            .Should()
            .BeEmpty();
            fileDetails.GitStats
            .Match(x => x.LifetimeAuthors,
                   () => 0)
            .Should()
            .Be(1);
        }
Пример #4
0
 public void IdShouldAlwaysBeEmptyString() =>
 MockRepo.CreateFile()
 .Id.Should()
 .BeEmpty();