Created
June 30, 2011 14:36
-
-
Save stack72/1056347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestCase("/categoryName/itemname", "/sitebaseaddress/hub/categoryName.aspx")] | |
public void GetDestinationUrl_ValidUrls_ReturnsCorrectDestionation(string url, string expected) | |
{ | |
var mappingLoader = Substitute.For<IMappingLoader>(); | |
var cacheHandler = Substitute.For<IMappingCacheHandler>(); | |
var httpContext = Substitute.For<IHttpContextFacade>(); | |
var mapping = new List<Data>(); | |
httpContext.GetAppPath().Returns("/sitebaseaddress/"); | |
cacheHandler.Load<Data>().Returns(mapping); | |
DataMap target = new DataMap(mappingLoader, cacheHandler, httpContext); | |
target.HttpContext = httpContext; | |
var actual = target.GetDestinationUrl(url); | |
Assert.That(actual, Is.EqualTo(expected)); | |
cacheHandler.Received().Save(mapping); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment