Example #1
0
        public void AddingMembersIsBinaryBackwardsCompatible()
        {
            var publicRoundTrippedNodes = FilteredApiNode.For(new PrinterConfig("", ""), RoundTrippedProjectApi);

            var compatibility = GetApiCompatiblity(publicRoundTrippedNodes, ThisProjectApi);

            Assert.That(compatibility, Is.EqualTo(BinaryApiCompatibility.BackwardsCompatible));
        }
Example #2
0
        public void RemovingMembersIsBinaryIncompatible()
        {
            var publicRoundTrippedNodes = FilteredApiNode.For(new PrinterConfig("", ""), RoundTrippedProjectApi);

            var compatibility = GetApiCompatiblity(ThisProjectApi, publicRoundTrippedNodes);

            Assert.That(compatibility, Is.EqualTo(BinaryApiCompatibility.Incompatible));
        }
Example #3
0
        private static async Task WritePublicApi(PublicApiWriter publicApiWriter, PrinterConfig printerConfig, string solutionOrProjectFilePath, string humanReadableFileName, string jsonFileName, CancellationToken cancellationToken)
        {
            var solutionNodes = await ApiReader.ReadApiFromProjects(solutionOrProjectFilePath, cancellationToken);

            var filteredNodes      = FilteredApiNode.For(printerConfig, solutionNodes).ToList();
            var writeHumanReadable = publicApiWriter.WriteHumanReadable(filteredNodes, new FileInfo(humanReadableFileName), cancellationToken);

            JsonSerialization.WriteJson(filteredNodes, new FileInfo(jsonFileName));
            await writeHumanReadable;
        }
 private static IApiNode GetFiltered(PrinterConfig printerConfig, IApiNode assemblyNode)
 {
     return(FilteredApiNode.For(printerConfig, new[] { assemblyNode }).Single());
 }