예제 #1
0
        public void LegalImpossibilityTest()
        {
            var testCrime = new Misdemeanor
            {
                MensRea = new GeneralIntent
                {
                    IsKnowledgeOfWrongdoing = lp => lp is MelissaEg2,
                    IsIntentOnWrongdoing    = lp => lp is MelissaEg2
                },
                ActusReus = new Attempt
                {
                    SubstantialSteps = new SubstantialSteps
                    {
                        IsPossessCriminalMaterial = lp => lp is MelissaEg2,
                    }
                }
            };

            var testResult = testCrime.IsValid(new MelissaEg2());

            Assert.IsTrue(testResult);

            var testSubject = new Impossibility(testCrime)
            {
                IsLegalImpossibility = MelissaEg2.IsLegal
            };

            var melissa = new MelissaEg2 {
                ItActuallyIsRatThatsBarking = true
            };

            testResult = testSubject.IsValid(melissa);
            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);
        }
예제 #2
0
        public void FactualImpossibilityTest()
        {
            var testCrime = new Misdemeanor
            {
                MensRea = new GeneralIntent
                {
                    IsKnowledgeOfWrongdoing = lp => lp is MelissaEg2,
                    IsIntentOnWrongdoing    = lp => lp is MelissaEg2
                },
                ActusReus = new Attempt
                {
                    SubstantialSteps = new SubstantialSteps
                    {
                        IsInvestigatingPotentialScene = lp => lp is MelissaEg2,
                        IsPossessCriminalMaterial     = lp => lp is MelissaEg2
                    }
                }
            };

            var testResult = testCrime.IsValid(new MelissaEg2());

            Assert.IsTrue(testResult);

            var testSubject = new Impossibility(testCrime)
            {
                IsFactualImpossibility = MelissaEg2.IsFactual
            };

            testResult = testSubject.IsValid(new MelissaEg2());
            Console.WriteLine(testSubject.ToString());
            Assert.IsFalse(testResult);
        }
예제 #3
0
        public void TestOnlyForAttempt()
        {
            var testCrime = new Misdemeanor
            {
                MensRea = new GeneralIntent
                {
                    IsKnowledgeOfWrongdoing = lp => lp is MelissaEg2,
                    IsIntentOnWrongdoing    = lp => lp is MelissaEg2
                },
                ActusReus = new ActusReus
                {
                    IsVoluntary = lp => lp is MelissaEg2,
                    IsAction    = lp => lp is MelissaEg2
                }
            };

            var testResult = testCrime.IsValid(new MelissaEg2());

            Assert.IsTrue(testResult);

            var testSubject = new Impossibility(testCrime)
            {
                IsLegalImpossibility = MelissaEg2.IsLegal
            };

            var melissa = new MelissaEg2 {
                ItActuallyIsRatThatsBarking = true
            };

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