public void GlobalLoginHistorySearchModel_Search_NoInput_ItemsFound()
 {
     // arrange
     var model = new GlobalLoginHistorySearchModel { StartDate = DateTime.Today, EndDate = DateTime.Now };
     // act
     model.Search(Repository);
     // assert
     Assert.IsTrue(model.SearchResults.Any());
     // annihilate
 }
 public void GlobalLoginHistorySearchModel_Search_NonExistingUser_NoItemsFound()
 {
     // arrange
     var model = new GlobalLoginHistorySearchModel { StartDate = DateTime.Today, EndDate = DateTime.Now, UserFullName = Guid.NewGuid().ToString(), FilterOptions = "%{0}%" };
     // act
     model.Search(Repository);
     // assert
     Assert.IsFalse(model.SearchResults.Any());
     // annihilate
 }
Example #3
0
        public ActionResult GlobalLoginHistory(GlobalLoginHistorySearchModel model)
        {
            try
            {
                model.Search();
            }
            catch (ArgumentException ex)
            {
                ShowErrorMessage(ex.Message);
            }

            return View(model);
        }