예제 #1
0
 private void ResetAssignments()
 {
     _isReportQueueCleared    = false;
     _isReportScheduleDeleted = false;
     _deletedReportQueueId.Clear();
     _deletedReportScheduleId.Clear();
     _savedReportSchedule = null;
 }
예제 #2
0
        private void SetUpFakesForSaveScheduleReportMethod(int blastReportId = BlastReportId, int ftpReportId = FtpReportId)
        {
            ResetAssignments();
            ShimReportSchedule.GetByBlastIdInt32 = (bid) => new List <ReportSchedule>
            {
                new ReportSchedule {
                    BlastID = 1
                },
                new ReportSchedule {
                    BlastID = 1, ReportID = blastReportId, ReportScheduleID = blastReportId
                },                                                                                               // Blast Report
                new ReportSchedule {
                    BlastID = 1, ReportID = ftpReportId, ReportScheduleID = ftpReportId
                },                                                                                           // FTP Report
            };

            ShimReports.GetByReportNameStringUser = (name, user) => new CommunicatorEntities.Reports
            {
                ReportID   = 1,
                ReportName = "BlastDetailsReport"
            };

            // Delete n Save Fakes section
            ShimReportQueue.Delete_ReportScheduleIDInt32 = (rptSchId) =>
            {
                _deletedReportQueueId.Add(rptSchId);
                _isReportQueueCleared = true;
            };
            ShimReportSchedule.DeleteInt32User = (bid, user) =>
            {
                _deletedReportScheduleId.Add(bid);
                _isReportScheduleDeleted = true;
            };
            ShimReportSchedule.SaveReportScheduleUser = (rpt, user) =>
            {
                _savedReportSchedule = rpt;
                return(_savedReportSchedule.ReportScheduleID);
            };
        }