Ejemplo n.º 1
0
 public void TestCallEntryFilter()
 {
     //Arrange
     JobModel model = new JobModel(new FakeUnitOfWork());
     //Act
     IList<CS_Job> resultList1 = model.CallEntryFilter(Globals.JobRecord.CallEntryFilter.Customer, "customer");
     IList<CS_Job> resultList2 = model.CallEntryFilter(Globals.JobRecord.CallEntryFilter.Division, "division");
     IList<CS_Job> resultList3 = model.CallEntryFilter(Globals.JobRecord.CallEntryFilter.JobNumber, "number");
     IList<CS_Job> resultList4 = model.CallEntryFilter(Globals.JobRecord.CallEntryFilter.Location, "new");
     //Assert
     Assert.AreEqual(1, resultList1.Count);
     Assert.AreEqual(1, resultList2.Count);
     Assert.AreEqual(3, resultList3.Count);
     Assert.AreEqual(1, resultList4.Count);
 }
 /// <summary>
 /// Retrieves filtered data for the JobFilter GridView
 /// </summary>
 public void GetJobFilterGridInfo()
 {
     try
     {
         using (_jobModel = new JobModel())
         {
             _view.JobFilterGridDataSource = _jobModel.CallEntryFilter(_view.JobFilterType, _view.JobFilterValue);
         }
     }
     catch (Exception ex)
     {
         Logger.Write(string.Format("An Error has ocurred while trying to GetJobFilterGridInfo.\n{0}\n{1}", ex.Message, ex.StackTrace));
         _view.DisplayMessage("An Internal Error has ocurred while trying to load the Information. Please try again.", false);
     }
 }