public void AnalyzingSelfFindsThisMethodAndOtherStuff() { using (var tempFileManager = new TempFileManager()) { var humanReadableFile = tempFileManager.GetNew(); var computerReadableFile = tempFileManager.GetNew(); RunMain(m_ThisProjectFile, humanReadableFile, computerReadableFile, "TestCode;AssemblyApiTests", @"OurCode;AssemblyApi\."); var lines = File.ReadAllLines(humanReadableFile.FullName); var linesContainingThisMethod = lines.Where(l => l.Contains(nameof(AnalyzingSelfFindsThisMethodAndOtherStuff))).ToList(); Assert.That(linesContainingThisMethod, Has.Count.EqualTo(1)); Assert.That(lines, Has.Length.GreaterThan(15)); } }
private static FileInfo WriteHumanReadable(IEnumerable <IApiNode> apiNodes, TempFileManager tempFileManager) { var outputFile = tempFileManager.GetNew(); new PublicApiWriter().WriteHumanReadable(apiNodes, outputFile, CancellationToken.None).Wait(); return(outputFile); }
private static IReadOnlyCollection <IApiNode> RoundTripApi(IReadOnlyCollection <IApiNode> originalApiNodes) { using (var tempFileManager = new TempFileManager()) { var outputFile = tempFileManager.GetNew(); JsonSerialization.WriteJson(originalApiNodes, outputFile); return(JsonSerialization.ReadJson(outputFile)); } }