Breaking all tests

5 posts, 0 answers
  1. Rush
    Rush avatar
    2 posts
    Member since:
    Oct 2013

    Posted 18 Oct 2013 Link to this post

    For 11/140 tests we are using JusMock. I just installed the latest version. When I enable the profiler and run all test though, they all break.  I have VS2010 ultimate and VS2013 ultimate. This is the error I am getting.

    Test Name:  BackButtonTest
    Test FullName:  BBA.POS.Test.NewTransactionViewModelTest.BackButtonTest
    Test Source:    c:\TFS\POS\POSApp\v3-Phase2\Source\BBA.POS.Test\NewTransactionViewModelTest.cs : line 995
    Test Outcome:   Failed
    Test Duration:  0:00:00.7688022
     
    Result Message:
    Test method BBA.POS.Test.NewTransactionViewModelTest.BackButtonTest threw exception:
    System.TypeInitializationException: The type initializer for '“•.’•' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: field
    TestCleanup method BBA.POS.Test.NewTransactionViewModelTest.MyTestCleanup threw exception. System.TypeInitializationException: System.TypeInitializationException: The type initializer for '“•.’•' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: field.
    Result StackTrace: 
    at System.Dynamic.Utils.ContractUtils.RequiresNotNull(Object value, String paramName)
       at System.Linq.Expressions.Expression.Field(Expression expression, FieldInfo field)
       at “•.’•.[](String •, Func`1& , Action`1& ™)
       at “•.’•..cctor()
     --- End of inner exception stack trace ---
        at “•.’•.Š•(Action ‹•)
       at Telerik.JustMock.Mock.Reset()
       at BBA.POS.Test.NewTransactionViewModelTest.BackButtonTest() in c:\TFS\POS\POSApp\v3-Phase2\Source\BBA.POS.Test\NewTransactionViewModelTest.cs:line 241
     
    TestCleanup Stack Trace
        at System.Dynamic.Utils.ContractUtils.RequiresNotNull(Object value, String paramName)
       at System.Linq.Expressions.Expression.Field(Expression expression, FieldInfo field)
       at “•.’•.[](String •, Func`1& , Action`1& ™)
       at “•.’•..cctor()
     --- End of inner exception stack trace ---
        at “•.’•.Š•(Action ‹•)
       at Telerik.JustMock.Mock.Reset()
       at BBA.POS.Test.NewTransactionViewModelTest.MyTestCleanup() in c:\TFS\POS\POSApp\v3-Phase2\Source\BBA.POS.Test\NewTransactionViewModelTest.cs:line 99

    When i disable the profiler, all of the non-justmock tests pass but the 11 fail. When I check in my code the build server says all tests pass, so I know it's just something on my machine causing the problem. Does anyone know how to fix this?



  2. Adiel
    Adiel avatar
    60 posts
    Member since:
    Jun 2012

    Posted 21 Oct 2013 Link to this post

    Hi 
    I've encounter the same issue. 
    Thanks
    Adiel
  3. DevCraft R3 2016 release webinar banner
  4. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 21 Oct 2013 Link to this post

    Hi Rush,

    When you say that on the build server everything is green, can you confirm that JustMock is updated to its latest version there?

    Further, please check if all of the JustMock references are updated accordingly inside your test projects. If this does not happen to be the case, I will require a sample project so I can reproduce the issue on our side. You should be able to attach it with your next reply.

    Thank you for the patience and the understanding in advance.

    Regards,
    Kaloyan
    Telerik
    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.
  5. Rush
    Rush avatar
    2 posts
    Member since:
    Oct 2013

    Posted 21 Oct 2013 Link to this post

    Version installed on the server is 2013.2.724.0

    Locally I have version 2013.3.1015.0

    The test project was referencing the older version. This seems like a problem. There couldn't have been that much that changed in between the two versions. Why isn't there a nuget package to keep projects and this extension up-to-date?

  6. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 21 Oct 2013 Link to this post

    Hi Rush,

    I am glad the issue is solved now.

    There is a JustMock NuGet package. However, it contains only the free version of JustMock. The reason for not having NuGet package for the commercial version of JustMock is that you will still need to manually register the profiler upon acquiring or updating it. This is something that the JustMock installer does automatically. However, we have plans to improve our products distribution during the upcoming development quarter. So, please visit our Ideas and Feedback portal in order to add your suggestions and feature requests there. It will help us a lot in finding the best possible approach for this.

    Let me know if there is more I can help you with.

    Regards,
    Kaloyan
    Telerik
    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
DevCraft R3 2016 release webinar banner