public void HinmanvPacificAirTransport() { var test = new TrespassToLand(ExtensionMethods.Tortfeasor) { IsTangibleEntry = lp => false, IsIntangibleEntry = lp => false, Injury = new NoDamage(), SubjectProperty = new LegalProperty("some land"), Causation = new Causation(ExtensionMethods.Tortfeasor) { FactualCause = new FactualCause(ExtensionMethods.Tortfeasor) { IsButForCaused = lp => lp is PacificAirTransport }, ProximateCause = new ProximateCause(ExtensionMethods.Tortfeasor) { IsDirectCause = lp => lp is PacificAirTransport, IsForeseeable = lp => lp is PacificAirTransport } } }; var testResult = test.IsValid(new Hinman(), new PacificAirTransport()); Assert.IsFalse(testResult); Console.WriteLine(test.ToString()); }
public void TestIntangibleEntry() { var testSubject = new TrespassToLand { Consent = new Consent { IsApprovalExpressed = lp => false, IsCapableThereof = lp => lp is Dougherty }, SubjectProperty = new RealProperty { Name = "unenclosed land of plaintiff", IsEntitledTo = lp => lp is Dougherty, IsInPossessionOf = lp => lp is Dougherty }, IsIntangibleEntry = lp => lp is Stepp, Causation = new Causation(ExtensionMethods.Tortfeasor) { FactualCause = new FactualCause(ExtensionMethods.Tortfeasor) { IsButForCaused = lp => lp is Stepp }, ProximateCause = new ProximateCause(ExtensionMethods.Tortfeasor) { IsForeseeable = lp => lp is Stepp } }, }; var testResult = testSubject.IsValid(new Dougherty(), new Stepp()); Console.WriteLine(testSubject.ToString()); Assert.IsFalse(testResult); testSubject.ClearReasons(); testSubject.Injury = new Damage(ExtensionMethods.Tortfeasor) { ToUsefulness = p => true }; testResult = testSubject.IsValid(new Dougherty(), new Stepp()); Console.WriteLine(testSubject.ToString()); Assert.IsTrue(testResult); }
public void VincentvLakeErieTranspCo() { var theBoat = new TheSteamshipReynolds(); var theDock = new DockInDuluth(); var tresspass = new TrespassToLand() { Causation = new Causation(ExtensionMethods.Tortfeasor) { FactualCause = new FactualCause(ExtensionMethods.Tortfeasor) { IsButForCaused = lp => lp is Vincent }, ProximateCause = new ProximateCause(ExtensionMethods.Tortfeasor) { IsForeseeable = lp => lp is Vincent } }, SubjectProperty = theDock, IsTangibleEntry = lp => lp is Vincent, Injury = new Damage(ExtensionMethods.Tortfeasor) { SubjectProperty = theDock, ToValue = pr => pr is DockInDuluth }, }; //assert that a trespass has occured var testResult = tresspass.IsValid(new Vincent(), new LakeErieTranspCo()); Assert.IsTrue(testResult); Console.WriteLine(tresspass.ToString()); var testDefense = new NecessityPrivilege <ITermCategory>(ExtensionMethods.Tortfeasor) { IsMultipleInHarm = lp => true, IsPublicInterest = lp => false, IsResponsibleForSituationArise = lp => false, Proportionality = new ChoiceThereof <ITermCategory>(ExtensionMethods.Tortfeasor) { GetChoice = lp => new NoDamage(), GetOtherPossibleChoices = lp => new [] { new Damage() } }, }; //w/o trespass assigned, no way to know damage so its a valid defense testResult = testDefense.IsValid(new Vincent(), new LakeErieTranspCo()); Assert.IsTrue(testResult); Console.WriteLine(testDefense.ToString()); testDefense.ClearReasons(); testDefense.Trespass = tresspass; testResult = testDefense.IsValid(new Vincent(), new LakeErieTranspCo()); Assert.IsFalse(testResult); Console.WriteLine(testDefense.ToString()); }
public void DoughertyvStepp() { var testSubject = new TrespassToLand { Consent = new Consent { IsApprovalExpressed = lp => false, IsCapableThereof = lp => lp is Dougherty }, SubjectProperty = new RealProperty { Name = "unenclosed land of plaintiff", IsEntitledTo = lp => lp is Dougherty, IsInPossessionOf = lp => lp is Dougherty }, IsTangibleEntry = lp => lp is Stepp }; var testResult = testSubject.IsValid(new Dougherty(), new Stepp()); Console.WriteLine(testSubject.ToString()); Assert.IsTrue(testResult); }