public void WithCustomUrlHelperOfTypeShouldNotThrowExceptionWithCorrectUrlHelper() { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.LocalRedirectActionWithCustomUrlHelper(urlHelper)) .ShouldReturn() .LocalRedirect() .WithUrlHelperOfType <CustomUrlHelper>(); }
public void WithCustomUrlHelperOfTypeShouldNotThrowExceptionWithCorrectUrlHelper() { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.CreatedAtActionWithCustomHelperResult(urlHelper)) .ShouldReturn() .Created(created => created .WithUrlHelperOfType <CustomUrlHelper>()); }
public void WithCustomUrlHelperShouldNotThrowExceptionWithCorrectUrlHelper() { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.RedirectToActionWithCustomUrlHelperResult(urlHelper)) .ShouldReturn() .Redirect(redirect => redirect .WithUrlHelper(urlHelper)); }
public void WithCustomUrlHelperOfTypeShouldNotThrowExceptionWithCorrectUrlHelper() { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyMvc .Controller <MvcController>() .Calling(c => c.RedirectToActionWithCustomUrlHelperResult(urlHelper)) .ShouldReturn() .Redirect() .WithUrlHelperOfType <CustomUrlHelper>(); }
public void WithCustomUrlHelperShouldNotThrowExceptionWithCorrectUrlHelper() { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyMvc .Controller <MvcController>() .Calling(c => c.CreatedAtActionWithCustomHelperResult(urlHelper)) .ShouldReturn() .Created() .WithUrlHelper(urlHelper); }
public void WithCustomUrlHelperOfTypeShouldThrowExceptionWithIncorrectUrlHelper() { Test.AssertException <RedirectResultAssertionException>( () => { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.LocalRedirectActionWithCustomUrlHelper(urlHelper)) .ShouldReturn() .LocalRedirect() .WithUrlHelperOfType <IUrlHelper>(); }, "When calling LocalRedirectActionWithCustomUrlHelper action in MvcController expected local redirect result UrlHelper to be of IUrlHelper type, but instead received CustomUrlHelper."); }
public void WithCustomUrlHelperShouldThrowExceptionWithIncorrectUrlHelper() { Test.AssertException <RedirectResultAssertionException>( () => { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.LocalRedirectActionWithCustomUrlHelper(urlHelper)) .ShouldReturn() .LocalRedirect() .WithUrlHelper(null); }, "When calling LocalRedirectActionWithCustomUrlHelper action in MvcController expected local redirect result UrlHelper to be the same as the provided one, but instead received different result."); }
public void WithCustomUrlHelperOfTypeShouldThrowExceptionWithIncorrectUrlHelper() { Test.AssertException <CreatedResultAssertionException>( () => { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.CreatedAtActionWithCustomHelperResult(urlHelper)) .ShouldReturn() .Created(created => created .WithUrlHelperOfType <IUrlHelper>()); }, "When calling CreatedAtActionWithCustomHelperResult action in MvcController expected created result URL helper to be of IUrlHelper type, but instead received CustomUrlHelper."); }
public void WithCustomUrlHelperShouldThrowExceptionWithIncorrectUrlHelper() { Test.AssertException <CreatedResultAssertionException>( () => { var urlHelper = TestObjectFactory.GetCustomUrlHelper(); MyController <MvcController> .Instance() .Calling(c => c.CreatedAtActionWithCustomHelperResult(urlHelper)) .ShouldReturn() .Created(created => created .WithUrlHelper(null)); }, "When calling CreatedAtActionWithCustomHelperResult action in MvcController expected created result URL helper to be the same as the provided one, but instead received different result."); }