{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Examples","type":"basic","slug":"examples","excerpt":"","body":"Here are some other random examples of assertions that you can make (see the documentation for the full list):\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"var vm = new SomeViewModel();\\n_controller.WithModelErrors().WithCallTo(c => c.Index(vm))\\n .ShouldRenderDefaultView()\\n .WithModel(vm);\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldRenderDefaultView()\\n .WithModel<ModelType>()\\n .AndModelErrorFor(m => m.Property1).ThatEquals(\\\"The error message.\\\")\\n .AndModelErrorFor(m => m.Property2);\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldRenderView(\\\"ViewName\\\");\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldReturnEmptyResult();\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldRedirectTo(\\\"http://www.google.com.au/\\\");\\n\\n_controller.WithCallTo(c => c.ActionWithRedirectToAction())\\n .ShouldRedirectTo(c => c.ActionInSameController);\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldRedirectTo<SomeOtherController>(c => c.SomeAction());\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldRenderAnyFile(\\\"content/type\\\");\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldRenderFileContents(\\\"text\\\");\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldReturnContent(\\\"expected content\\\");\\n\\n_controller.WithCallTo(c => c.Index())\\n .ShouldGiveHttpStatus(404);\\n\\n_controller.WithCallTo(c => c.Index()).ShouldReturnJson(data =>\\n{\\n Assert.That(data.SomeProperty, Is.EqualTo(\\\"SomeValue\\\");\\n});\",\n \"language\": \"csharp\"\n }\n ]\n}\n[/block]\nA real-world example can be seen in the `AndTakeUserToASuccessPage` method of the `SuccessfulTeamResetPasswordScenario` code snippet shown in one of [Rob's blog posts](http://robdmoore.id.au/blog/2015/01/26/review-of-jimmy-bogard-holistic-testing/).","updates":[],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"54cfd0413995cf0d0006f73f","user":"54c4ca54686bce0d00efe1b9","category":{"sync":{"isSync":false,"url":""},"pages":["54cfd0413995cf0d0006f73f"],"title":"Examples","slug":"examples","order":1,"from_sync":false,"reference":false,"_id":"54cfd0295ff7e617002bbdd9","__v":1,"createdAt":"2015-02-02T19:29:45.527Z","project":"54cfb736bba1a0230087419e","version":"54cfb736bba1a023008741a1"},"githubsync":"","__v":2,"createdAt":"2015-02-02T19:30:09.698Z","project":"54cfb736bba1a0230087419e","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["54cfb737bba1a023008741a2","54cfc6f75ff7e617002bbdae","54cfcbaebba1a023008741fc","54cfd0295ff7e617002bbdd9","54cfd05b3995cf0d0006f741"],"_id":"54cfb736bba1a023008741a1","releaseDate":"2015-02-02T17:43:18.560Z","__v":5,"createdAt":"2015-02-02T17:43:18.560Z","project":"54cfb736bba1a0230087419e"}}