Пример #1
0
        public void ExampleCaveBasedOnThreat()
        {
            var testAct = new ByExtortion
            {
                IsTakenPossession = lp => lp is RodneyBlackmailEg,
                Threatening       = new ByExtortion.ByThreatening
                {
                    IsToAccuseOfCrime = lp => lp is RodneyBlackmailEg
                },
                SubjectProperty = new LegalProperty("fifteen thousand dollars")
                {
                    PropertyValue = dt => 15000m
                },
                Consent = new VictimConsent
                {
                    IsApprovalExpressed = lp => true,
                    IsCapableThereof    = lp => lp is LindseyDealinEg
                }
            };

            var testResult = testAct.IsValid(new RodneyBlackmailEg(), new LindseyDealinEg());

            Console.WriteLine(testAct.ToString());
            Assert.IsTrue(testResult);
        }
Пример #2
0
        public void ExampleExtortionAct()
        {
            var testAct = new ByExtortion
            {
                IsTakenPossession = lp => lp is RodneyBlackmailEg,
                Threatening       = new ByExtortion.ByThreatening
                {
                    IsToAccuseOfCrime = lp => lp is RodneyBlackmailEg
                },
                SubjectProperty = new LegalProperty("fifteen thousand dollars")
                {
                    PropertyValue = dt => 15000m
                },
            };

            var testResult = testAct.IsValid(new RodneyBlackmailEg(), new LindseyDealinEg());

            Console.WriteLine(testAct.ToString());
            Assert.IsTrue(testResult);
        }
Пример #3
0
        public void ExampleThreatenHonestlyDue()
        {
            var trent           = new TrentThreatenEg();
            var thousandDollars = new LegalProperty("thousand dollars")
            {
                IsEntitledTo = lp => lp.IsSamePerson(trent), PropertyValue = dt => 10000m
            };
            var testAct = new ByExtortion
            {
                IsTakenPossession = lp => lp is TrentThreatenEg,
                Threatening       = new ByExtortion.ByThreatening
                {
                    IsToExposeHurtfulSecret = lp => lp is TrentThreatenEg
                },
                SubjectProperty = thousandDollars,
            };

            var testResult = testAct.IsValid(new TrentThreatenEg(), new TaraLyingEg());

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