Beispiel #1
0
        public void DutyReportIsCorrectlyGeneratedAndReset()
        {
            mockReporter.Setup(f => f.GetPrefill()).Returns("test");
            var now = DateTime.Now;

            ctrls.Start.Value    = now;
            ctrls.End.Value      = now.AddMinutes(90);
            ctrls.Arrests.Text   = "2";
            ctrls.Citations.Text = "4";
            var ctrlr = new DutyReportController(ctrls, () => mockReporter.Object, typeof(FakeReporter));

            ctrls.Notes.Text = "some notes";
            btnGenDutyReport.SimulateMouseUp(MouseButtons.Left);
            Assert.AreEqual(1, FakeReporter.ctorCalls.Count);
            var args = FakeReporter.ctorCalls[0];
            var i    = 0;

            Assert.AreEqual(now, (DateTime)args[i++]);
            Assert.AreEqual(now.AddMinutes(90), (DateTime)args[i++]);
            Assert.AreEqual(2, (decimal)args[i++]);
            Assert.AreEqual(4, (decimal)args[i++]);
            Assert.AreEqual("some notes", args[i++] as string);
            btnGenDutyReport.SimulateMouseUp(MouseButtons.Right);
            Assert.AreEqual("test", ctrls.Notes.Text);
            mockReporter.Verify(f => f.GetPrefill());
        }
Beispiel #2
0
        public LSPDPMainForm()
        {
            InitializeComponent();

            var arcControl = new ArrestReportController.Controls {
                SuspName           = txtSuspect,
                SuspPhone          = txtSuspPhone,
                LicensesRevoked    = chkLicensesRevoked,
                ArrestingOfficers  = txtArrestingOfficers,
                Mugshot            = txtMugshot,
                ChkCrimes          = chkCrimes,
                Narrative          = txtNarrative,
                BtnGovEmployee     = btnGovEmployee,
                BtnAttempted       = btnAttempted,
                BtnAccessory       = btnAccessory,
                BtnAggravated      = btnAggravated,
                SuggestCharge      = txtSuggestCharge,
                BtnGenArrestReport = btnGenArrestReport,
            };

            _ = new ArrestReportController(arcControl, suspMgr,
                                           () => new ArrestReporter(),
                                           typeof(ArrestReporter),
                                           crimeList,
                                           "https://gov.eclipse-rp.net/posting.php?mode=reply&f=159&t=19");

            var ircControl = new ImpoundReportController.Controls {
                SuspName            = txtVehOwner,
                SuspPhone           = txtPhoneNumber,
                LicensePlate        = txtLicensePlate,
                VehicleModel        = txtVehModel,
                VehicleColor        = txtVehColour,
                VehicleDetails      = txtVehDetails,
                ImpoundTime         = dtImpoundTime,
                Location            = txtImpoundLocation,
                Reason              = txtReason,
                Officers            = txtOfficersInvolved,
                Screenshot          = txtScreenshot,
                TimestampConverter  = txtTimestamp,
                BtnGenImpoundReport = btnGenImpoundReport,
            };

            _ = new ImpoundReportController(ircControl,
                                            suspMgr,
                                            () => new ImpoundReporter(),
                                            typeof(ImpoundReporter),
                                            "https://gov.eclipse-rp.net/posting.php?mode=reply&f=565&t=7636");

            var irrcControl = new ImpoundReleaseReportController.Controls {
                SuspName            = txtRelVehOwner,
                SuspPhone           = txtRelPhoneNum,
                LicensePlate        = txtRelLicense,
                VehicleModel        = txtRelModel,
                VehicleColor        = txtRelColour,
                ImpoundDate         = txtRelDate,
                ImpOfficer          = txtRelOfficer,
                ReleaseFee          = txtRelFee,
                BtnGenReleaseReport = btnGenReleaseReport,
            };

            _ = new ImpoundReleaseReportController(irrcControl,
                                                   suspMgr,
                                                   typeof(ImpoundReleaseReporter),
                                                   "https://gov.eclipse-rp.net/posting.php?mode=reply&f=565&t=7641");

            var drcControl = new DutyReportController.Controls {
                Start            = dtWatchStart,
                End              = dtWatchEnd,
                Arrests          = numArrests,
                Citations        = numCitations,
                Notes            = txtNotes,
                BtnGenDutyReport = btnGenDutyReport,
            };

            _ = new DutyReportController(drcControl,
                                         () => new DutyReporter(),
                                         typeof(DutyReporter),
                                         OfficerData.OfficerDRs);

            var flControl = new FirearmLicenseController.Controls {
                Name            = txtApplicant,
                PrevDenial      = chkDeniedBefore,
                IsFormB         = chkIsFormB,
                LastOffence     = dtLastOffence,
                DateOfBirth     = dtDOB,
                FormA           = chkFormA,
                FormB           = chkFormB,
                ActiveOffence   = activeOffence,
                Underage        = lblUnderage,
                NameUnderscored = btnNameUnderscore,
                GenBkgndChk     = btnGenBkgndChk,
                GenReport       = btnGenFirearmsVerdict,
            };

            _ = new FirearmLicenseController(flControl, typeof(FirearmLicenseReporter), typeof(BackgroundCheckReporter), rejList);
        }