MSTest/nUnit weirdness

6 posts, 0 answers
  1. Craig
    Craig avatar
    20 posts
    Member since:
    Jun 2012

    Posted 18 Dec 2011 Link to this post

    Hi,

    We have some unit tests that we are trying to convert from MSTest to nUnit. When we run the unit tests (using Resharper) in MSTest they run without any exceptions, but when we try to run it in NUnit they fail.

    The code we are running is:
    var httpResponse = new HttpResponse(null);
    var httpRequest =
    new HttpRequest(string.Empty, "http://somewhere.com/", null);
    var currentContext = Mock.Create<HttpContext>(() =>
    new HttpContext(httpRequest, httpResponse));
    Mock.Arrange(() => HttpContext.Current).Returns(currentContext);
    Assert.IsNotNull(HttpContext.Current);
    Assert.IsNotNull(HttpContext.Current.Request);<br>

    Using nUnit it fails on the first assertion.

    Any ideas why this is happening?


    Craig
  2. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 22 Dec 2011 Link to this post

    Hi Craig,

    Thanks again for reporting the issue. I ran the test with R#  test runner and it did failed. However, it passes while running with TestDriven.Net. It could be that R# has some compatibility issue with JustMock where the profiling variables are not initialized properly when running with it. But I am logging this into our system to further investigate. In the meantime, you can use TestDriven.Net RTM that works perfectly with JM along with NUnit.

    Sorry for the inconvenience.

    PITS issue to track further:
    http://www.telerik.com/support/pits.aspx#/public/justmock/9007

    Kind Regards,
    Mehfuz
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft R3 2016 release webinar banner
  4. Craig
    Craig avatar
    20 posts
    Member since:
    Jun 2012

    Posted 01 Mar 2012 Link to this post

    Does anyone know if this issue has been fixed in the 2012 Q1 release?


    Craig
  5. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 02 Mar 2012 Link to this post

    Hi Craig,

    Unfortunately, there are still some capability issues with R# test runner and JustMock. In the meantime, I would request you to use TestDriven.NET for the purpose.


    Kind Regards,
    Mehfuz
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Craig
    Craig avatar
    20 posts
    Member since:
    Jun 2012

    Posted 04 Mar 2012 Link to this post

    Hi Mehfuz,

    Unfortunately TestDriven.NET is not an option as this requires purchasing licenses. Do you have any timeframe for when you can investigate the issue?


    Craig
  7. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 05 Mar 2012 Link to this post

    Hi Craig,

    Thanks again for the reply.

    However, you can also try considering the personal version of TDD.NET which is free and by any chance if you have Telerik subscription then you can consider trying JustCode that has a test runner and works nicely with JustMock.

    Kind Regards,
    Mehfuz
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
DevCraft R3 2016 release webinar banner