예제 #1
0
            public void ImpoundReportTimestampIsCorrectlyConverted()
            {
                var ctrlr = new ImpoundReportController(ctrls, mockSuspMgr.Object, () => mockReporter.Object, typeof(FakeReporter));
                var now   = new DateTime(2020, 8, 23, 7, 15, 24);
                var secs  = now - new DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime();

                ctrls.TimestampConverter.Text = ((long)secs.TotalSeconds).ToString();
                Assert.AreEqual(now, ctrls.ImpoundTime.Value);
                ctrls.TimestampConverter.Text = "";
                Assert.AreEqual(now, ctrls.ImpoundTime.Value);
            }
예제 #2
0
            public void ImpoundReportIsCorrectlyGeneratedAndReset()
            {
                mockReporter.Setup(f => f.GetPrefill()).Returns("prefill");
                var ctrlr = new ImpoundReportController(ctrls, mockSuspMgr.Object, () => mockReporter.Object, typeof(FakeReporter));

                mockReporter.VerifyAll();
                var now = DateTime.Now;

                ctrls.SuspName.Text       = "some crim";
                ctrls.SuspPhone.Text      = "3434343";
                ctrls.LicensePlate.Text   = "asdgf";
                ctrls.VehicleModel.Text   = "Bifta";
                ctrls.VehicleColor.Text   = "Blue";
                ctrls.VehicleDetails.Text = "stuff";
                ctrls.ImpoundTime.Value   = now;
                ctrls.Location.Text       = "loc";
                ctrls.Reason.Text         = "rsn";
                ctrls.Officers.Text       = "john smith";
                ctrls.Screenshot.Text     = "scrn";
                btnGenReport.SimulateMouseUp(MouseButtons.Left);
                Assert.AreEqual(1, FakeReporter.ctorCalls.Count);
                var args = FakeReporter.ctorCalls[0];
                var i    = 0;

                Assert.AreEqual("Some Crim", args[i++] as string);
                Assert.AreEqual("3434343", args[i++] as string);
                Assert.AreEqual("ASDGF", args[i++] as string);
                Assert.AreEqual("Bifta", args[i++] as string);
                Assert.AreEqual("Blue", args[i++] as string);
                Assert.AreEqual("stuff", args[i++] as string);
                Assert.AreEqual(now, (DateTime)args[i++]);
                Assert.AreEqual("loc", args[i++] as string);
                Assert.AreEqual("rsn", args[i++] as string);
                Assert.AreEqual("John Smith", args[i++] as string);
                Assert.AreEqual("scrn", args[i++] as string);

                mockReporter.Setup(f => f.GetPrefill()).Returns("prefill");
                btnGenReport.SimulateMouseUp(MouseButtons.Right);
                mockReporter.VerifyAll();
                Assert.AreEqual("prefill", ctrls.Officers.Text);
            }
예제 #3
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);
        }