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(); }
public void WhenCreatesANewFileObject() { var file = MockRepo.CreateFile(); file.Should() .NotBeSameAs(file.With()); }
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); }
public void IdShouldAlwaysBeEmptyString() => MockRepo.CreateFile() .Id.Should() .BeEmpty();