public void ExampleMistakeOfFactIncorrect() { var testCrime = new Misdemeanor { ActusReus = new ActusReus { IsVoluntary = lp => lp is TinaEg, IsAction = lp => lp is TinaEg, }, MensRea = StrictLiability.Value }; var testResult = testCrime.IsValid(new TinaEg()); Assert.IsTrue(testResult); var testSubject = new MistakeOfFact { IsBeliefNegateIntent = lp => lp is TinaEg, IsStrictLiability = testCrime.MensRea is StrictLiability }; testResult = testSubject.IsValid(new TinaEg()); Console.WriteLine(testSubject.ToString()); Assert.IsFalse(testResult); }
public void GarnettvState() { var testCrime = new Felony { ActusReus = new ActusReus { IsVoluntary = lp => lp is Garnett, IsAction = lp => lp is Garnett }, MensRea = StrictLiability.Value }; var testResult = testCrime.IsValid(new Garnett()); Assert.IsTrue(testResult); var testSubject = new MistakeOfFact { IsBeliefNegateIntent = lp => lp is Garnett, IsStrictLiability = testCrime.MensRea is StrictLiability }; testResult = testSubject.IsValid(new Garnett()); Console.WriteLine(testSubject.ToString()); Assert.IsFalse(testResult); }
public void ExampleMistakeOfFactCorrect() { var testCrime = new Misdemeanor { ActusReus = new ActusReus { IsVoluntary = lp => lp is MickieEg, IsAction = lp => lp is MickieEg, }, MensRea = new GeneralIntent { //this is the point, prosecution says this, mistake-of-fact undo's it IsKnowledgeOfWrongdoing = lp => lp is MickieEg } }; var testResult = testCrime.IsValid(new MickieEg()); Assert.IsTrue(testResult); var testSubject = new MistakeOfFact { IsBeliefNegateIntent = lp => lp is MickieEg, IsStrictLiability = testCrime.MensRea is StrictLiability }; testResult = testSubject.IsValid(new MickieEg()); Console.WriteLine(testSubject.ToString()); Assert.IsTrue(testResult); }