예제 #1
0
        public void GivenAddititveApiChangeThenMinorVersionIncreases()
        {
            var oldApi     = ApiBuilder.CreateApi("1");
            var comparison = ApiNodeComparison.Compare(new[] { oldApi }, new[] { oldApi, ApiBuilder.CreateApi("") });

            Assert.That(comparison.GetNewSemanticVersion(new Version(1, 0, 0, 0)).AssemblyFileVersion, Is.EqualTo(new Version(1, 1, 0, 0)));
        }
예제 #2
0
        public async Task UnchangingPartOfApiDoesNotAppearInComparison()
        {
            var sameApi          = ApiBuilder.CreateApi("same");
            var comparison       = ApiNodeComparison.Compare(new [] { sameApi, ApiBuilder.CreateApi("1") }, new [] { sameApi, ApiBuilder.CreateApi("2") });
            var differenceString = await comparison.GetDifferencesString();

            Assert.That(differenceString, Does.Not.Contain("same"));
        }
예제 #3
0
 private static IReadOnlyCollection <ApiNodeComparison> Compare(IApiNode oldApi, IApiNode newApi)
 {
     return(ApiNodeComparison.Compare(new[] { oldApi }, new[] { newApi }));
 }
예제 #4
0
        private BinaryApiCompatibility GetApiCompatiblity(IEnumerable <IApiNode> originalApi, IEnumerable <IApiNode> newApi)
        {
            var binaryApiComparer = new BinaryApiComparer();

            return(binaryApiComparer.GetApiChangeType(ApiNodeComparison.Compare(originalApi, newApi)));
        }