diff --git a/tests/Moq.Analyzers.Test/CallbackSignatureShouldMatchMockedMethodCodeFixTests.cs b/tests/Moq.Analyzers.Test/CallbackSignatureShouldMatchMockedMethodCodeFixTests.cs index 60a3e9d6..18370a91 100644 --- a/tests/Moq.Analyzers.Test/CallbackSignatureShouldMatchMockedMethodCodeFixTests.cs +++ b/tests/Moq.Analyzers.Test/CallbackSignatureShouldMatchMockedMethodCodeFixTests.cs @@ -73,6 +73,10 @@ public static IEnumerable TestData() """new Mock().Setup(x => x.Do(It.IsAny>())).Returns(0).Callback((List l) => { });""", """new Mock().Setup(x => x.Do(It.IsAny>())).Returns(0).Callback((List l) => { });""", ], + [ // Repro for https://github.com/rjmurillo/moq.analyzers/issues/172 + """new Mock().Setup(m => m.DoSomething(It.IsAny())).Returns((object? bar) => true);""", + """new Mock().Setup(m => m.DoSomething(It.IsAny())).Returns((object? bar) => true);""", + ], }.WithNamespaces().WithMoqReferenceAssemblyGroups(); } @@ -91,6 +95,8 @@ internal interface IFoo int Do(int i, string s, DateTime dt); int Do(List l); + + bool DoSomething(object? bar); } internal class UnitTest