Skip to content

Commit b33d80c

Browse files
committed
Fix issue with it.IsAny completion when working with overloads
1 parent 010695a commit b33d80c

13 files changed

Lines changed: 220 additions & 15 deletions

Abc.MoqComplete/Abc.MoqComplete.Tests/Completion/AutoMockerItIsAnyProviderActionTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class AutoMockerItIsAnyProviderActionTests : CodeCompletionTestBase
1414
[TestCase("itIsAnyCompletionFull")]
1515
[TestCase("itIsAnyCompletionParam")]
1616
[TestCase("itIsAnyCompletionGeneric")]
17+
[TestCase("itIsAnyCompletionOverload")]
18+
[TestCase("itIsAnyCompletionOverloadAndGenerics")]
1719
[TestCase("itIsAnyVerifyCompletionFull")]
1820
public void should_fill_with_it_isAny(string testSrc)
1921
{

Abc.MoqComplete/Abc.MoqComplete.Tests/Completion/ItIsAnyProviderActionTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class ItIsAnyProviderActionTests : CodeCompletionTestBase
1414
[TestCase("itIsAnyCompletionFull")]
1515
[TestCase("itIsAnyCompletionParam")]
1616
[TestCase("itIsAnyCompletionGeneric")]
17+
[TestCase("itIsAnyCompletionOverload")]
18+
[TestCase("itIsAnyCompletionOverloadAndGenerics")]
1719
[TestCase("itIsAnyVerifyCompletionFull")]
1820
public void should_fill_with_it_isAny(string testSrc) => DoOneTest(testSrc);
1921
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using Moq;
3+
using Moq.AutoMock;
4+
using NUnit.Framework;
5+
6+
namespace ConsoleApp1.Tests
7+
{
8+
public interface ITestInterface
9+
{
10+
decimal GetGrossAmountInEuro(decimal price, decimal quantity, int securityId, int currencyId, decimal spotRateInEuro);
11+
decimal GetGrossAmountInEuro(string message);
12+
decimal GetGrossAmountInEuro(int trade);
13+
14+
void Build(int temp);
15+
}
16+
17+
[TestFixture]
18+
public class Test1
19+
{
20+
[Test]
21+
public void METHOD()
22+
{
23+
var mock = new AutoMocker();
24+
mock.Setup<ITestInterface>(x=>x.GetGrossAmountInEuro(It{caret}))
25+
}
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using Moq;
3+
using Moq.AutoMock;
4+
using NUnit.Framework;
5+
6+
namespace ConsoleApp1.Tests
7+
{
8+
public interface ITestInterface
9+
{
10+
decimal GetGrossAmountInEuro(decimal price, decimal quantity, int securityId, int currencyId, decimal spotRateInEuro);
11+
decimal GetGrossAmountInEuro(string message);
12+
decimal GetGrossAmountInEuro(int trade);
13+
14+
void Build(int temp);
15+
}
16+
17+
[TestFixture]
18+
public class Test1
19+
{
20+
[Test]
21+
public void METHOD()
22+
{
23+
var mock = new AutoMocker();
24+
mock.Setup<ITestInterface>(x=>x.GetGrossAmountInEuro(It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>())){caret}
25+
}
26+
}
27+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using NUnit.Framework;
3+
using System;
4+
using Moq;
5+
using Moq.AutoMock;
6+
7+
namespace ConsoleApp1.Tests
8+
{
9+
public interface ITestInterface<T>
10+
{
11+
decimal GetGrossAmountInEuro(decimal price, T quantity, int securityId, int currencyId, decimal spotRateInEuro);
12+
decimal GetGrossAmountInEuro(string message);
13+
decimal GetGrossAmountInEuro(int trade);
14+
15+
void Build(int temp);
16+
}
17+
18+
[TestFixture]
19+
public class Test1
20+
{
21+
[Test]
22+
public void METHOD()
23+
{
24+
var mock = new AutoMocker();
25+
mock.Setup<ITestInterface<decimal>>(x=>x.GetGrossAmountInEuro(It{caret}))
26+
}
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using NUnit.Framework;
3+
using System;
4+
using Moq;
5+
using Moq.AutoMock;
6+
7+
namespace ConsoleApp1.Tests
8+
{
9+
public interface ITestInterface<T>
10+
{
11+
decimal GetGrossAmountInEuro(decimal price, T quantity, int securityId, int currencyId, decimal spotRateInEuro);
12+
decimal GetGrossAmountInEuro(string message);
13+
decimal GetGrossAmountInEuro(int trade);
14+
15+
void Build(int temp);
16+
}
17+
18+
[TestFixture]
19+
public class Test1
20+
{
21+
[Test]
22+
public void METHOD()
23+
{
24+
var mock = new AutoMocker();
25+
mock.Setup<ITestInterface<decimal>>(x=>x.GetGrossAmountInEuro(It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>())){caret}
26+
}
27+
}
28+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using Moq;
3+
4+
namespace ConsoleApp1.Tests
5+
{
6+
public interface ITestInterface
7+
{
8+
decimal GetGrossAmountInEuro(decimal price, decimal quantity, int securityId, int currencyId, decimal spotRateInEuro);
9+
decimal GetGrossAmountInEuro(string message);
10+
decimal GetGrossAmountInEuro(int trade);
11+
12+
void Build(int temp);
13+
}
14+
15+
public class Test1
16+
{
17+
public void METHOD()
18+
{
19+
var mock = new Mock<ITestInterface>();
20+
mock.Setup(x=>x.GetGrossAmountInEuro(it{caret}))
21+
}
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using Moq;
3+
4+
namespace ConsoleApp1.Tests
5+
{
6+
public interface ITestInterface
7+
{
8+
decimal GetGrossAmountInEuro(decimal price, decimal quantity, int securityId, int currencyId, decimal spotRateInEuro);
9+
decimal GetGrossAmountInEuro(string message);
10+
decimal GetGrossAmountInEuro(int trade);
11+
12+
void Build(int temp);
13+
}
14+
15+
public class Test1
16+
{
17+
public void METHOD()
18+
{
19+
var mock = new Mock<ITestInterface>();
20+
mock.Setup(x=>x.GetGrossAmountInEuro(It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>())){caret}
21+
}
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using Moq;
3+
4+
namespace ConsoleApp1.Tests
5+
{
6+
public interface ITestInterface<T>
7+
{
8+
decimal GetGrossAmountInEuro(decimal price, T quantity, int securityId, int currencyId, decimal spotRateInEuro);
9+
decimal GetGrossAmountInEuro(string message);
10+
decimal GetGrossAmountInEuro(int trade);
11+
12+
void Build(int temp);
13+
}
14+
15+
public class Test1
16+
{
17+
public void METHOD()
18+
{
19+
var mock = new Mock<ITestInterface<decimal>>();
20+
mock.Setup(x=>x.GetGrossAmountInEuro(it{caret}))
21+
}
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ${COMPLETE_ITEM:It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>()}
2+
using Moq;
3+
4+
namespace ConsoleApp1.Tests
5+
{
6+
public interface ITestInterface<T>
7+
{
8+
decimal GetGrossAmountInEuro(decimal price, T quantity, int securityId, int currencyId, decimal spotRateInEuro);
9+
decimal GetGrossAmountInEuro(string message);
10+
decimal GetGrossAmountInEuro(int trade);
11+
12+
void Build(int temp);
13+
}
14+
15+
public class Test1
16+
{
17+
public void METHOD()
18+
{
19+
var mock = new Mock<ITestInterface<decimal>>();
20+
mock.Setup(x=>x.GetGrossAmountInEuro(It.IsAny<decimal>(), It.IsAny<decimal>(), It.IsAny<int>(), It.IsAny<int>(), It.IsAny<decimal>())){caret}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)