New answers tagged

1

By mocking a proper return type(GetPreviousProductsResponse) value for the injected service(_productService) instead of a model property(PreviousProducts) solved this issue. _productService.GetPreviousProducts(Arg.Any<GetPreviousProductsParameters>()).Returns(new GetPreviousProductsResponse); The test still doesn't return 'ViewResult' type as intended ...


0

What you need to do is to call Sitecore.Resources.Media.HashingUtils.ProtectAssetUrl: var url = MediaManager.GetMediaUrl(mediaItem, options); var protectedUrl = HashingUtils.ProtectAssetUrl(url); This will calculate the hash value based on the parameters from the url.


Top 50 recent answers are included