public async Task ReturnsBreakingWhenInterfaceChangesName() { var oldCode = new List <CodeSource> { new(SingleInterface) }; var newCode = new List <CodeSource> { new(SingleInterface.Replace("MyInterface", "MyNewInterface")) }; var options = OptionsFactory.BuildOptions(); var result = await _calculator.CalculateChanges(oldCode, newCode, options, CancellationToken.None) .ConfigureAwait(false); result.ChangeType.Should().Be(SemVerChangeType.Breaking); }
public async Task EvaluatesChangeOfInterfaceAccessModifiers( string oldModifiers, string newModifiers, SemVerChangeType expected) { var oldCode = new List <CodeSource> { new( SingleInterface.Replace("public interface MyInterface", oldModifiers + " interface MyInterface")) }; var newCode = new List <CodeSource> { new( SingleInterface.Replace("public interface MyInterface", newModifiers + " interface MyInterface")) }; var options = OptionsFactory.BuildOptions(); var result = await _calculator.CalculateChanges(oldCode, newCode, options, CancellationToken.None) .ConfigureAwait(false); result.ChangeType.Should().Be(expected); }