-
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.
Allow callback completion after ReturnAsync method
- Loading branch information
Showing
10 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
...lete/Abc.MoqComplete.Tests/data/CallbackCompletion/callbackCompletion_afterReturnAsync.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:Callback<int,string,bool>((i,toto,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>())) | ||
.ReturnsAsync(0) | ||
.c{caret} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...Abc.MoqComplete.Tests/data/CallbackCompletion/callbackCompletion_afterReturnAsync.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:Callback<int,string,bool>((i,toto,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>())) | ||
.ReturnsAsync(0) | ||
.Callback<int,string,bool>((i,toto,ok) => {{caret}}) | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
....MoqComplete.Tests/data/CallbackCompletion/callbackCompletion_afterReturnAsyncMultiple.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:Callback<int,string,bool>((i,toto,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>())) | ||
.ReturnsAsync<int, string, bool, ITestInterface, int>((i, j, k) => 42) | ||
.c{caret} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...omplete.Tests/data/CallbackCompletion/callbackCompletion_afterReturnAsyncMultiple.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:Callback<int,string,bool>((i,toto,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>())) | ||
.ReturnsAsync<int, string, bool, ITestInterface, int>((i, j, k) => 42) | ||
.Callback<int,string,bool>((i,toto,ok) => {{caret}}) | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...MoqComplete.Tests/data/CallbackCompletion/callbackCompletion_afterReturnAsyncMultiple2.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:Callback<int,string,bool>((i,toto,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>())) | ||
.ReturnsAsync((int i, string j, bool k) => 42) | ||
.c{caret} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...mplete.Tests/data/CallbackCompletion/callbackCompletion_afterReturnAsyncMultiple2.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:Callback<int,string,bool>((i,toto,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>())) | ||
.ReturnsAsync((int i, string j, bool k) => 42) | ||
.Callback<int,string,bool>((i,toto,ok) => {{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
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