Missing ReturnsCollection

7 posts, 0 answers
  1. Shawn
    Shawn avatar
    11 posts
    Member since:
    Sep 2013

    Posted 06 Jul Link to this post

    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;
            }
       }
    }

     

  2. Shawn
    Shawn avatar
    11 posts
    Member since:
    Sep 2013

    Posted 06 Jul Link to this post

    After closing and re-opening Visual Studio, the "Returns Collection" function started appearing.
  3. DevCraft R3 2016 release webinar banner
  4. Svetlozar
    Admin
    Svetlozar avatar
    269 posts

    Posted 11 Jul Link to this post

    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
    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
  5. Shawn
    Shawn avatar
    11 posts
    Member since:
    Sep 2013

    Posted 18 Jul in reply to Svetlozar Link to this post

    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.

  6. Nikolay Valchev
    Admin
    Nikolay Valchev avatar
    72 posts

    Posted 21 Jul Link to this post

    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
    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
  7. Shawn
    Shawn avatar
    11 posts
    Member since:
    Sep 2013

    Posted 21 Jul in reply to Nikolay Valchev Link to this post

    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.
  8. Nikolay Valchev
    Admin
    Nikolay Valchev avatar
    72 posts

    Posted 22 Jul Link to this post

    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
    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
Back to Top
DevCraft R3 2016 release webinar banner