NuGet package for JustMock pro?

2 posts, 1 answers
  1. Micah
    Micah avatar
    4 posts
    Member since:
    Aug 2013

    Posted 20 Aug 2013 Link to this post

    Is there a NuGet package for JustMock non-lite?  Since the features of non-lite require a profiler it seems that you wouldn't be losing anything by making the .NET assemblies for the non-lite version available on NuGet since users would still have to purchase a license to actually use the features provided in the assembly.

    Myself and one of my peers (we'll call him Bob) are working together on a project.  I install JustMock to the default install path (C:\Program Files (x86)\Telerik\JustMock) while he installs to D:\Programs\JustMock.  I keep my source code in C:\Users\Micah\Source\GitHub\awesome and he stores it in C:\source\awesome.  I add JustMock to our UnitTest project (in the awesome repo) by adding a reference to C:\Users\Micah\Documents\Source\dotnet_agent\Agent\packages\JustMock.2013.3.819\lib\Net35\Telerik.JustMock.dll.  I commit and push this change to GitHub and then Bob pulls the change down.  He then attempts to build and receives an error saying the assembly couldn't be found.

    There appear to be a few solutions, though none of them seem particularly clean:
    1. Copy Telerik.JustMock.dll to our repo and reference it there.
    2. Have all developers copy Telerik.JustMock.dll to the GAC.
    3. Have all developers use the same install path for JustMock.
    4. Have all developers use the same install path for JustMock and the source code.

    Problems with each:
    1. Telerik.JustMock.dll has to match the version of the profiler that is installed.  The same problem would occur with a NuGet package.
    1. I have to know which of the JustMock\Libraries assemblies I need.  Right now I am just using JustMock.dll but I have only scratched the surface of JustMock, will I need others like JustMock.Container or Practices.Unity?
    2. It is easy to forget to do this when building out a new machine or onboarding a new developer.
    2. Every time a user upgrades JustMock they have to re-copy the assemblies or risk versioning related failures.
    3,4. Everyone sets up their workspace differently, some developers may not even be able to match the folder structure of others (perhaps their whole OS and applications are on D drive or they are running x86 version of the OS).

    A NuGet package still has the versioning issue but at least it is one that can be reported as an intelligible error at runtime and it eliminates all of the other problems.

    Assuming a NuGet package isn't available, what solution is recommended in the meantime?  I am most fond of #1 but I don't know which assemblies to copy.  Insight wanted.
  2. Answer
    Kaloyan avatar
    880 posts

    Posted 22 Aug 2013 Link to this post

    Hello Micah,

    Thank you for the detailed message.

    Unfortunately, there is no NuGet package for the commercial version of JustMock. This is so, because (as you have noted) the paid version requires a profiler registration, which is done by the JustMock installer. Performing such configuration (profiler registration) through a NuGet package can be tricky and having only the JustMock assemblies into NuGet could lead to a version mismatch between them and the profiler.

    Further, I went through your options and I also think the first one is the most suitable. Next, I will try to give answers for the matters that bother:
    •  "Telerik.JustMock.dll has to match the version of the profiler that is installed.  The same problem would occur with a NuGet package."
      • Let`s assume you have updated JustMock on your local machine. Now, I can think of two possible approaches:

        The first one is to check-in the new JustMock assemblies to the repo along with the Telerik.CodeWeaver.Profiler.DLL. As the Telerik.JustMock assemblies are being referred automatically to your projects, the profiler will still need a registration on the server. You will need a custom build step that does this. This is common scenario and it makes your build self-contained. Once, everything needed is checked-in, there should be no worries.

        The second approach is a bit more cumbersome. Here, you will again need to check-in the updated JustMock assemblies to the repo. However, instead of registering the profiler manually (or inside a build step), you can log in to the build server and simply install JustMock there. This will take care for the profiler registration.
    • "I have to know which of the JustMock\Libraries assemblies I need.  Right now I am just using JustMock.dll but I have only scratched the surface of JustMock, will I need others like JustMock.Container or Practices.Unity?"
      • The assemblies, you might need are: Telerik.JustMock.dll, Telerik.JustMock.Container.dll, Telerik.JustMock.Silverlight.dll and Telerik.JustMock.VisualBasic.dll. However, I would recommend having the whole Libraries folder inside your repo. Next, I will try to give explanation about all the DLLs that you may need on your build machine:

        Telerik.JustMock.dll - This is the core JustMock assembly. It needs to be referred to every test project that is not running the Silverlight runtime.
        Telerik.JustMock.Container.dll - This is the assembly needed in order to use the Automocking feature inside your test projects. 
        Telerik.JustMock.Silverlight.dll - This is the assembly needed in order to perform mocking inside Silverlight. More about it can be found here.
        Telerik.JustMock.VisualBasic.dll - This assembly is used only for VB.Net projects. Although you can also use the Telerik.JustMock.dll inside such projects, the VisualBasic dll consists of some extensions that might come helpful.
        Telerik.CodeWeaver.Profiler.dll - Found in Libraries\CodeWeaver\32\ and 64\, this is the JustMock profiler. Note that you will need to register both the 32 and the 64 bit versions of this dll.
        Telerik.JustMock.Build.Workflow.dll and Telerik.JustMock.Build.Workflow.VS2012.dll - These are used for integrating JustMock in a TFS activity workflow. More can be found here.
        Telerik.JustMock.MSBuild.dll - This assembly is needed for integrating JustMock within MSBuild task process. For more information, please check this link.

        Further, there are also tools like the Telerik.JustMock.Configuration.exe and the JustMockRunner.exe needed for linking the profiler with other 3rd party profiler using tools (like coverage) and running the JustMock profiler outside Visual Studio.

        Finally, it is up to you to decide which of the assemblies are needed on your build machine :).

    I hope this information helps. Please, let me know if I can be of further assistance.

    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Back to Top