public void Return_View_Containing_Profiles_As_Model() { var controller = new HomeController(); var model = controller.Search(DefaultLocation, DefaultLanguage).GetModel<IList<Profile>>(); Assert.IsNotNull(model); }
public void User_Searcher_To_Fetch_Profiles_For_Location_By_Technology() { var searcher = Mock.Create<IProfileSearcher>(); var controller = new HomeController(new PasswordRetriever(), searcher); controller.Search(DefaultLocation, DefaultLanguage); searcher.Assert(s => s.GetProfilesForLocationByTechnology(DefaultLocation, DefaultLanguage)); }
public void Sets_Error_In_The_ViewBag_On_RateLimitException() { var searcher = Mock.Create<IProfileSearcher>(); searcher.Arrange(s => s.GetProfilesForLocationByTechnology(Arg.AnyString, Arg.AnyString)).Throws(new RateLimitException()); var controller = new HomeController(new PasswordRetriever(), searcher); controller.Search(DefaultLocation, DefaultLanguage); Assert.AreEqual<string>("Rate limit has been exceeded.", controller.ViewBag.ErrorMessage); }