public void TestInitialize() { _mockContext = new ReportingEntitiesMock(); _log = new Mock<ILogger>(); _repository = new Mock<IRepository>(); _updateActivityData = new UpdateActivityData(_repository.Object, _log.Object); }
/// <summary> /// This method first checks that the tool should be run (correct day of week to avoid picking up weekend activity + tbDailyActivityGP /// // has been updated in the last 24 hours) before checking for any inactive sites and sending any inactive reports. /// </summary> public void RunCheck() { // Check running tool won't issue inactive reports based on weekend activity if (RunningCheckWillPickUpWeekendActivity() == true) { _log.Add("Running app today would pick up weekend activity. Run aborted."); return; } // Check that tbDailyActivityGP has been updated UpdateActivityData updateActivityData = new UpdateActivityData(_repository, _log); if (updateActivityData.CheckActivityDataHasBeenUpdated() == false) { _log.Add("tbDailyActivityGP was not updated yesterday"); return; } // Update tbRPT_InactiveSites updateActivityData.UpdateData(); ReportInactiveSites reportInactiveSites = new ReportInactiveSites(_repository, _log); // if number of inactive sites per healthboard limit is to be observed if (_applyHealthBoardInactiveSiteLimit == true) { if (reportInactiveSites.NumberOfInactiveSitesPerHealthBoardLimitExceeded() == false) { // Send inactive reports reportInactiveSites.SendInactiveReports(); } } else // Ignore limit - send inactive email reports regardless of how many inactive sites there are { // Send inactive reports reportInactiveSites.SendInactiveReports(); } }