コード例 #1
0
        public void EnsignvWalls()
        {
            var property = new LegalProperty("13949 Dacosta Street")
            {
                IsInPossessionOf = lp => lp is Walls,
                IsEntitledTo     = lp => lp is Walls
            };
            var test = new PrivateNuisance(ExtensionMethods.Tortfeasor)
            {
                SubjectProperty = property,
                IsInvasionOfProtectableInterest = lp => lp is Ensign,
                IsNegligentInvasion             = lp => lp is Walls
            };
            var testResult = test.IsValid(new Ensign(), new Walls());

            Assert.IsTrue(testResult);
            Console.WriteLine(test.ToString());
        }
        public void FortyFiveTwentyFiveIncvFontainebleauHotelCorp()
        {
            var rocHotel = new LegalProperty("Roc Hotel")
            {
                IsEntitledTo     = lp => lp is FortyFiveTwentyFiveInc,
                IsInPossessionOf = lp => lp is FortyFiveTwentyFiveInc
            };
            var test = new PrivateNuisance(ExtensionMethods.Tortfeasor)
            {
                IsIntentionalInvasion           = lp => lp is FontainebleauHotelCorp,
                IsInvasionOfProtectableInterest = lp => false,
                SubjectProperty = rocHotel,
                Consent         = new Consent(ExtensionMethods.Tortfeasor)
                {
                    IsApprovalExpressed = lp => false,
                    IsCapableThereof    = lp => true
                }
            };
            var testResult = test.IsValid(new FortyFiveTwentyFiveInc(), new FontainebleauHotelCorp());

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