public void VerifyDoesNotShowForNoSymbol() { // Arrange var analyzer = new MemberImplementsInterfaceAnalyzer(); // Act var shouldShow = analyzer.Show(symbol: null); // Assert Assert.IsFalse(shouldShow, $"The analyzer will be unexpectedly shown for no symbol"); }
public void VerifyDoesNotShowForStaticMembers(SymbolKind symbolKind) { // Arrange var memberMock = SetupMemberMock(symbolKind, TypeKind.Unknown, isStatic: true); var analyzer = new MemberImplementsInterfaceAnalyzer(); // Act var shouldShow = analyzer.Show(memberMock.Object); // Assert Assert.IsFalse(shouldShow, $"The analyzer will be unexpectedly shown for static symbol '{symbolKind}'"); }
public void VerifyDoesNotShowForNonMembers(SymbolKind symbolKind) { // Arrange var symbolMock = new Mock <ISymbol>(); symbolMock.Setup(s => s.SymbolKind).Returns(symbolKind); var analyzer = new MemberImplementsInterfaceAnalyzer(); // Act var shouldShow = analyzer.Show(symbolMock.Object); // Assert Assert.IsFalse(shouldShow, $"The analyzer will be unexpectedly shown for symbol '{symbolKind}'"); }
public void VerifyShowsForSupportedTypes( [ValueSource(nameof(ValidSymbolKinds))] SymbolKind symbolKind, [ValueSource(nameof(ValidTypeKinds))] TypeKind typeKind) { // Arrange var memberMock = SetupMemberMock(symbolKind, typeKind, isStatic: false); var analyzer = new MemberImplementsInterfaceAnalyzer(); // Act var shouldShow = analyzer.Show(memberMock.Object); // Assert Assert.IsTrue(shouldShow, $"The analyzer will not be shown for symbol '{symbolKind}' and '{typeKind}'"); }
public void VerifyDoesNotShowForUnsupportedTypes( [ValueSource(nameof(ValidSymbolKinds))] SymbolKind symbolKind, [ValueSource(nameof(InvalidTypeKinds))] TypeKind typeKind) { // Arrange var memberMock = SetupMemberMock(symbolKind, typeKind, isStatic: true); var analyzer = new MemberImplementsInterfaceAnalyzer(); // Act var shouldShow = analyzer.Show(memberMock.Object); // Assert Assert.IsFalse(shouldShow, $"The analyzer will be unexpectedly shown for symbol '{symbolKind}' and '{typeKind}'"); }