I'm unable to find the ReturnsCollection in Telerik Just Mock. Here is the line that is giving me issues. I've got the following using statements, but the Telerik.JustMock.Helpers shows it isn't used.
The version of JustMock is v2016.2.421.1
using
Telerik.JustMock;
using
Telerik.JustMock.Helpers;
Mock.Arrange(() => fakeContext.Employees).ReturnsCollection(FakeDataSource.FakeEmployees());
The"fakeContext" is defined as such
public
class
jhaCommonMock : DbContext
{
public
DbSet<EmployeeDTO> Employees {
get
;
set
; }
public
DbSet<DepartmentDto> Departments {
get
;
set
; }
}
Here is a sample of my FakeDataSource
public
static
class
FakeDataSource
{
public
static
IList<EmployeeDTO> FakeEmployees()
{
List<EmployeeDTO> fakeEmpList =
new
List<EmployeeDTO>
{
new
EmployeeDTO
{
FirstName=
"Test"
,
LastName =
"Employee"
,
NetworkID =
"testEmployee"
,
Inactive =
false
}
};
return
fakeEmpList;
}
}
}
6 Answers, 1 is accepted
0
Shawn
Top achievements
Rank 1
answered on 06 Jul 2016, 07:08 PM
After closing and re-opening Visual Studio, the "Returns Collection" function started appearing.
0
Hi,
I am glad you've managed to resolve the issue, although I have no idea what might have caused it.
If you encounter any issues, please don't hesitate to write back.
Regards,
Svetlozar
Telerik by Progress
I am glad you've managed to resolve the issue, although I have no idea what might have caused it.
If you encounter any issues, please don't hesitate to write back.
Regards,
Svetlozar
Telerik by Progress
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Shawn
Top achievements
Rank 1
answered on 18 Jul 2016, 04:15 PM
This is happening again. I've found that restarting Visual Studio seems to Trigger the JustMock update references, which seemed to resolved it locally. However, on our Build Server, that isn't happening. I manually check the Reference update and it says the references are current.
The installed version is 2016.2.426.1 listed in NuGet Manager.
0
Hello Shawn,
Unfortunately, this feature is unavailable in JustMock Lite edition, hence you should use the full version of JustMock to take advantage of it.
The reason it is working locally is because when you load the solution, JustMock's Visual Studio extension updates the reference of the assembly with the one coming from the full version. On the other hand, on your Build Server, JustMock is installed through NuGet i.e. it is using JustMock Lite and, as I mentioned earlier, ReturnsCollection is not available in this edition.
Best Regards,
Nikolay Valchev
Telerik by Progress
Unfortunately, this feature is unavailable in JustMock Lite edition, hence you should use the full version of JustMock to take advantage of it.
The reason it is working locally is because when you load the solution, JustMock's Visual Studio extension updates the reference of the assembly with the one coming from the full version. On the other hand, on your Build Server, JustMock is installed through NuGet i.e. it is using JustMock Lite and, as I mentioned earlier, ReturnsCollection is not available in this edition.
Best Regards,
Nikolay Valchev
Telerik by Progress
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Shawn
Top achievements
Rank 1
answered on 21 Jul 2016, 01:38 PM
To enable/upgrade to the full version, is that done via the Telerik Control Panel? We have the full license, just want to make sure that is the way to enable that.
0
Hello Shawn,
You can install it through the Telerik Control Panel, just make sure that the project referencing JustMock is pointing to the full version.
Let us know if you need any further assistance!
Best Regards,
Nikolay Valchev
Telerik by Progress
You can install it through the Telerik Control Panel, just make sure that the project referencing JustMock is pointing to the full version.
Let us know if you need any further assistance!
Best Regards,
Nikolay Valchev
Telerik by Progress
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items