diff --git a/Abc.MoqComplete/Abc.MoqComplete.Tests/data/AutoMockerReturnsCompletion/returnsCompletion.cs.gold b/Abc.MoqComplete/Abc.MoqComplete.Tests/data/AutoMockerReturnsCompletion/returnsCompletion.cs.gold index 978d000..3b18ca8 100644 --- a/Abc.MoqComplete/Abc.MoqComplete.Tests/data/AutoMockerReturnsCompletion/returnsCompletion.cs.gold +++ b/Abc.MoqComplete/Abc.MoqComplete.Tests/data/AutoMockerReturnsCompletion/returnsCompletion.cs.gold @@ -1,24 +1,2 @@ -// ${COMPLETE_ITEM:Returns((i,toto,ok) => )} -using Moq; -using Moq.AutoMock; -using NUnit.Framework; -namespace ConsoleApp1.Tests -{ - public interface ITestInterface - { - void BuildSomething(int i, string toto, bool ok); - } - - [TestFixture] - public class Test1 - { - [Test] - public void METHOD() - { - var _mocker = new AutoMocker(); - _mocker.Setup(x => x.BuildSomething(It.IsAny(),It.IsAny(), It.IsAny())) - .Returns((i,toto,ok) => {caret}) - } - } -} \ No newline at end of file +Raises{caret} \ No newline at end of file diff --git a/Abc.MoqComplete/Abc.MoqComplete.Tests/data/ReturnsCompletion/returnsCompletion.cs.gold b/Abc.MoqComplete/Abc.MoqComplete.Tests/data/ReturnsCompletion/returnsCompletion.cs.gold index 989d932..3b18ca8 100644 --- a/Abc.MoqComplete/Abc.MoqComplete.Tests/data/ReturnsCompletion/returnsCompletion.cs.gold +++ b/Abc.MoqComplete/Abc.MoqComplete.Tests/data/ReturnsCompletion/returnsCompletion.cs.gold @@ -1,23 +1,2 @@ -// ${COMPLETE_ITEM:Returns((i,toto,ok) => )} -using Moq; -using NUnit.Framework; -namespace ConsoleApp1.Tests -{ - public interface ITestInterface - { - void BuildSomething(int i, string toto, bool ok); - } - - [TestFixture] - public class Test1 - { - [Test] - public void METHOD() - { - Mock temp = new Mock(); - temp.Setup(x => x.BuildSomething(It.IsAny(),It.IsAny(), It.IsAny())) - .Returns((i,toto,ok) => {caret}) - } - } -} \ No newline at end of file +Raises{caret} \ No newline at end of file diff --git a/Abc.MoqComplete/Abc.MoqComplete/CompletionProvider/Returns/BaseReturnsMethodProvider.cs b/Abc.MoqComplete/Abc.MoqComplete/CompletionProvider/Returns/BaseReturnsMethodProvider.cs index 54c0bdb..421edcf 100644 --- a/Abc.MoqComplete/Abc.MoqComplete/CompletionProvider/Returns/BaseReturnsMethodProvider.cs +++ b/Abc.MoqComplete/Abc.MoqComplete/CompletionProvider/Returns/BaseReturnsMethodProvider.cs @@ -63,7 +63,7 @@ protected override bool AddLookupItems(CSharpCodeCompletionContext context, IIte var mockedMethod = GetMockedMethodFromSetupMethod(solution, invocation); - if (mockedMethod == null || mockedMethod.Parameters.Count == 0) + if (mockedMethod == null || mockedMethod.Parameters.Count == 0 || mockedMethod.ReturnType.IsVoid()) { return false; } diff --git a/Abc.MoqComplete/Directory.Build.props b/Abc.MoqComplete/Directory.Build.props index 10556a7..629624f 100644 --- a/Abc.MoqComplete/Directory.Build.props +++ b/Abc.MoqComplete/Directory.Build.props @@ -22,7 +22,7 @@ - 1.3.0 + 1.3.1