-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
389 additions
and
70 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Abc.MoqComplete/Abc.MoqComplete.Tests/Completion/ReturnsAsyncMethodProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using JetBrains.ReSharper.FeaturesTestFramework.Completion; | ||
using JetBrains.ReSharper.TestFramework; | ||
using NUnit.Framework; | ||
|
||
namespace Abc.MoqComplete.Tests.Completion | ||
{ | ||
[TestNetCore21("Moq/4.18.1")] | ||
public class ReturnsAsyncMethodProviderTests: CodeCompletionTestBase | ||
{ | ||
protected override CodeCompletionTestType TestType => CodeCompletionTestType.Action; | ||
protected override string RelativeTestDataPath => "ReturnsAsyncCompletion"; | ||
|
||
[TestCase("returnsAsyncCompletion")] | ||
[TestCase("returnsAsyncCompletion_afterCallback")] | ||
[TestCase("returnsAsyncCompletion_generic")] | ||
[TestCase("ValueTask_returnsAsyncCompletion")] | ||
[TestCase("ValueTask_returnsAsyncCompletion_afterCallback")] | ||
[TestCase("ValueTask_returnsAsyncCompletion_generic")] | ||
public void should_fill_with_callback(string testSrc) => DoOneTest(testSrc); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ete/Abc.MoqComplete.Tests/data/ReturnsAsyncCompletion/ValueTask_returnsAsyncCompletion.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((int i, string toto, bool ok) => )} | ||
using Moq; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITestInterface | ||
{ | ||
ValueTask BuildSomething(int i, string toto, bool ok); | ||
} | ||
|
||
[TestFixture] | ||
public class Test1 | ||
{ | ||
[Test] | ||
public void METHOD() | ||
{ | ||
Mock<ITestInterface> temp = new Mock<ITestInterface>(); | ||
temp.Setup(x => x.BuildSomething(It.IsAny<int>(),It.IsAny<string>(), It.IsAny<bool>())) | ||
.R{caret} | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...bc.MoqComplete.Tests/data/ReturnsAsyncCompletion/ValueTask_returnsAsyncCompletion.cs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
Returns<int, string, bool>((i, toto, ok) => ) | ||
Returns{caret} |
25 changes: 25 additions & 0 deletions
25
...plete.Tests/data/ReturnsAsyncCompletion/ValueTask_returnsAsyncCompletion_afterCallback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((int i, string toto, bool ok) => )} | ||
using Moq; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITestInterface | ||
{ | ||
ValueTask<int> BuildSomething(int i, string toto, bool ok); | ||
} | ||
|
||
[TestFixture] | ||
public class Test1 | ||
{ | ||
[Test] | ||
public void METHOD() | ||
{ | ||
Mock<ITestInterface> temp = new Mock<ITestInterface>(); | ||
temp.Setup(x => x.BuildSomething(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<bool>())) | ||
.Callback<int, string, bool>((i, toto, ok) => {}) | ||
.R{caret} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
....Tests/data/ReturnsAsyncCompletion/ValueTask_returnsAsyncCompletion_afterCallback.cs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((int i, string toto, bool ok) => )} | ||
using Moq; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITestInterface | ||
{ | ||
ValueTask<int> BuildSomething(int i, string toto, bool ok); | ||
} | ||
|
||
[TestFixture] | ||
public class Test1 | ||
{ | ||
[Test] | ||
public void METHOD() | ||
{ | ||
Mock<ITestInterface> temp = new Mock<ITestInterface>(); | ||
temp.Setup(x => x.BuildSomething(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<bool>())) | ||
.Callback<int, string, bool>((i, toto, ok) => {}) | ||
.ReturnsAsync((int i, string toto, bool ok) => {caret}) | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...MoqComplete.Tests/data/ReturnsAsyncCompletion/ValueTask_returnsAsyncCompletion_generic.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((ITest2 test, double test2, string test3) => )} | ||
using NUnit.Framework; | ||
using Moq; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITest<T, U> | ||
{ | ||
ValueTask<int> Coco(ITest2 test, T test2, U test3); | ||
|
||
} | ||
public interface ITest2 : ITest<double, string> | ||
{ | ||
|
||
} | ||
|
||
[TestFixture] | ||
public class TestClass | ||
{ | ||
|
||
[Test] | ||
public void METHOD() | ||
{ | ||
var m = new Mock<ITest2>(); | ||
m.Setup(x=>x.Coco(It.IsAny<ITest2>(), It.IsAny<double>(), It.IsAny<string>())) | ||
.{caret} | ||
|
||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...mplete.Tests/data/ReturnsAsyncCompletion/ValueTask_returnsAsyncCompletion_generic.cs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((ITest2 test, double test2, string test3) => )} | ||
using NUnit.Framework; | ||
using Moq; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITest<T, U> | ||
{ | ||
ValueTask<int> Coco(ITest2 test, T test2, U test3); | ||
|
||
} | ||
public interface ITest2 : ITest<double, string> | ||
{ | ||
|
||
} | ||
|
||
[TestFixture] | ||
public class TestClass | ||
{ | ||
|
||
[Test] | ||
public void METHOD() | ||
{ | ||
var m = new Mock<ITest2>(); | ||
m.Setup(x=>x.Coco(It.IsAny<ITest2>(), It.IsAny<double>(), It.IsAny<string>())) | ||
.ReturnsAsync((ITest2 test, double test2, string test3) => {caret}) | ||
|
||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Abc.MoqComplete/Abc.MoqComplete.Tests/data/ReturnsAsyncCompletion/returnsAsyncCompletion.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((int i, string toto, bool ok) => )} | ||
using Moq; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITestInterface | ||
{ | ||
Task BuildSomething(int i, string toto, bool ok); | ||
} | ||
|
||
[TestFixture] | ||
public class Test1 | ||
{ | ||
[Test] | ||
public void METHOD() | ||
{ | ||
Mock<ITestInterface> temp = new Mock<ITestInterface>(); | ||
temp.Setup(x => x.BuildSomething(It.IsAny<int>(),It.IsAny<string>(), It.IsAny<bool>())) | ||
.R{caret} | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...Complete/Abc.MoqComplete.Tests/data/ReturnsAsyncCompletion/returnsAsyncCompletion.cs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
Returns<int, string, bool>((i, toto, ok) => ) | ||
Returns{caret} |
25 changes: 25 additions & 0 deletions
25
...Abc.MoqComplete.Tests/data/ReturnsAsyncCompletion/returnsAsyncCompletion_afterCallback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((int i, string toto, bool ok) => )} | ||
using Moq; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITestInterface | ||
{ | ||
Task<int> BuildSomething(int i, string toto, bool ok); | ||
} | ||
|
||
[TestFixture] | ||
public class Test1 | ||
{ | ||
[Test] | ||
public void METHOD() | ||
{ | ||
Mock<ITestInterface> temp = new Mock<ITestInterface>(); | ||
temp.Setup(x => x.BuildSomething(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<bool>())) | ||
.Callback<int, string, bool>((i, toto, ok) => {}) | ||
.R{caret} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...oqComplete.Tests/data/ReturnsAsyncCompletion/returnsAsyncCompletion_afterCallback.cs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((int i, string toto, bool ok) => )} | ||
using Moq; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITestInterface | ||
{ | ||
Task<int> BuildSomething(int i, string toto, bool ok); | ||
} | ||
|
||
[TestFixture] | ||
public class Test1 | ||
{ | ||
[Test] | ||
public void METHOD() | ||
{ | ||
Mock<ITestInterface> temp = new Mock<ITestInterface>(); | ||
temp.Setup(x => x.BuildSomething(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<bool>())) | ||
.Callback<int, string, bool>((i, toto, ok) => {}) | ||
.ReturnsAsync((int i, string toto, bool ok) => {caret}) | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...plete/Abc.MoqComplete.Tests/data/ReturnsAsyncCompletion/returnsAsyncCompletion_generic.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((ITest2 test, double test2, string test3) => )} | ||
using NUnit.Framework; | ||
using Moq; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITest<T, U> | ||
{ | ||
Task<int> Coco(ITest2 test, T test2, U test3); | ||
|
||
} | ||
public interface ITest2 : ITest<double, string> | ||
{ | ||
|
||
} | ||
|
||
[TestFixture] | ||
public class TestClass | ||
{ | ||
|
||
[Test] | ||
public void METHOD() | ||
{ | ||
var m = new Mock<ITest2>(); | ||
m.Setup(x=>x.Coco(It.IsAny<ITest2>(), It.IsAny<double>(), It.IsAny<string>())) | ||
.{caret} | ||
|
||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
.../Abc.MoqComplete.Tests/data/ReturnsAsyncCompletion/returnsAsyncCompletion_generic.cs.gold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ${COMPLETE_ITEM:ReturnsAsync((ITest2 test, double test2, string test3) => )} | ||
using NUnit.Framework; | ||
using Moq; | ||
using System.Threading.Tasks; | ||
|
||
namespace ConsoleApp1.Tests | ||
{ | ||
public interface ITest<T, U> | ||
{ | ||
Task<int> Coco(ITest2 test, T test2, U test3); | ||
|
||
} | ||
public interface ITest2 : ITest<double, string> | ||
{ | ||
|
||
} | ||
|
||
[TestFixture] | ||
public class TestClass | ||
{ | ||
|
||
[Test] | ||
public void METHOD() | ||
{ | ||
var m = new Mock<ITest2>(); | ||
m.Setup(x=>x.Coco(It.IsAny<ITest2>(), It.IsAny<double>(), It.IsAny<string>())) | ||
.ReturnsAsync((ITest2 test, double test2, string test3) => {caret}) | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.