bishop335 / subtext

Automatically exported from code.google.com/p/subtext
0 stars 0 forks source link

Tests that involve verifying calls to Response.RedirectPermanent are failing #246

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Tests that are verifying the correctness code that use 
Response.RedirectPermanent are failing:

One test is:
UnitTests.Subtext.Framework.Web.HttpModules.BlogRequestModuleTests.
ConvertRequestToBlogRequest_WithRequestForAlternateHost_RedirectsToPrimaryHost

the code of the SUT correctly calls the Response.RedirectPermanent
but then the test fails because the mock object for the response is not 
correctly updated.

The second test is:

UnitTests.Subtext.Framework.Data.CacherTests.
GetEntryFromRequest_WithEntryHavingEntryNameButIdInRouteDataMatchingEntryInRepos
itory_RedirectsToUrlWithSlug

Same happens here: RedirectPermanent is called, but the mock response object is 
not updated accordingly.

Might be a way Moq works with .NET 4 or a different way for .NET 4 to treat 
dependencies in the httpcontext.

Original issue reported on code.google.com by simone.chiaretta on 30 Jul 2010 at 10:19

GoogleCodeExporter commented 8 years ago
The verifications on the tests are just incorrect after the upgrade. 
Response.RedirectPermanent was only introduced in .NET 4 so previously the 
properties would have been set directly for a permanent redirect and therefore 
show up on the mock object.

Original comment by CoxyOnl...@gmail.com on 14 Dec 2010 at 10:44

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you
will apply the patch asaic

Original comment by simone.chiaretta on 14 Dec 2010 at 11:19

GoogleCodeExporter commented 8 years ago
I fixed this in r4159 and r4156

Original comment by haac...@gmail.com on 27 Dec 2010 at 6:05