This is a migrated thread and some comments may be shown as answers.

MSTest/nUnit weirdness

5 Answers 39 Views
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 19 Dec 2011, 04:22 AM
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

5 Answers, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 22 Dec 2011, 09:29 AM
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 >>

0
Craig
Top achievements
Rank 1
answered on 01 Mar 2012, 11:26 PM
Does anyone know if this issue has been fixed in the 2012 Q1 release?


Craig
0
Ricky
Telerik team
answered on 02 Mar 2012, 04:05 PM
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 >>
0
Craig
Top achievements
Rank 1
answered on 05 Mar 2012, 02:20 AM
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
0
Ricky
Telerik team
answered on 05 Mar 2012, 04:07 PM
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 >>
Asked by
Craig
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Craig
Top achievements
Rank 1
Share this question
or