public void PeoplevRegister() { var testCrime = new Felony { ActusReus = new ActusReus { IsAction = lp => lp is Register, IsVoluntary = lp => lp is Register, }, MensRea = new GeneralIntent { IsKnowledgeOfWrongdoing = lp => lp is Register, } }; var testResult = testCrime.IsValid(new Register()); Assert.IsTrue(testResult); var testSubject = new Intoxication { IsIntoxicated = lp => lp is Register, IsInvoluntary = lp => !(lp is Register), }; testResult = testSubject.IsValid(new Register()); Console.WriteLine(testSubject.ToString()); Assert.IsFalse(testResult); }
public void ExampleIntoxication() { var testCrime = new Felony { ActusReus = new ActusReus { IsAction = lp => lp is DelilahEg, IsVoluntary = lp => lp is DelilahEg, }, MensRea = new GeneralIntent { IsIntentOnWrongdoing = lp => lp is DelilahEg, } }; var testResult = testCrime.IsValid(new DelilahEg()); Assert.IsTrue(testResult); var testSubject = new Intoxication { //the ruffee is taken unknowingly IsInvoluntary = lp => lp is DelilahEg, IsIntoxicated = lp => lp is DelilahEg }; testResult = testSubject.IsValid(new DelilahEg()); Console.WriteLine(testSubject.ToString()); Assert.IsTrue(testResult); }