コード例 #1
0
        public void TestReasonableSuspicionIsValid00()
        {
            var testSubject = new ReasonableSuspicion
            {
                IsFactsConcludeToCriminalActivity = lp => lp is ExampleLawEnforcement,
                Stop = new SuspectStop
                {
                    IsBeliefFreeToGo               = lp => false,
                    GetDetainedTimespan            = lp => new TimeSpan(0, 15, 0),
                    GetRequiredInvestigateTimespan = lp => new TimeSpan(0, 20, 0)
                }
            };

            var testResult =
                testSubject.IsValid(new ExampleSuspect(), new ExampleLawEnforcement(), new ExampleInformant());

            Assert.IsTrue(testResult);
            Console.WriteLine(testSubject.ToString());
        }
コード例 #2
0
        public void TestReasonableSuspicionIsValid02()
        {
            var testSubject = new ReasonableSuspicion
            {
                GetInformationSource = lps => lps.FirstOrDefault(lp => lp is ExampleLawEnforcement),
                IsFactsConcludeToCriminalActivity = lp => lp is ExampleLawEnforcement,
                Stop = new SuspectStop
                {
                    IsBeliefFreeToGo               = lp => false,
                    GetDetainedTimespan            = lp => new TimeSpan(3, 0, 0),
                    GetRequiredInvestigateTimespan = lp => new TimeSpan(0, 20, 0)
                }
            };

            var testResult =
                testSubject.IsValid(new ExampleSuspect(), new ExampleLawEnforcement(),
                                    new ExampleInformant {
                IsInformationSufficientlyReliable = true
            });

            Console.WriteLine(testSubject.ToString());
            Assert.IsFalse(testResult);
        }