Пример #1
0
        public void BergvWiley()
        {
            var testLease = new Leasehold()
            {
                Inception       = new DateTime(1970, 12, 1),
                SubjectProperty = new RealProperty("building in Osseo, Minnesota")
                {
                    IsInPossessionOf = lp => lp is Berg, IsEntitledTo = lp => lp is Wiley
                },
                Terminus = new DateTime(1975, 12, 1)
            };

            var testResult = testLease.IsValid(new Berg(), new Wiley());

            Assert.IsTrue(testResult);

            var test = new Eviction(testLease)
            {
                CurrentDateTime        = new DateTime(1973, 7, 16),
                IsBreachLeaseCondition = lp => false,
                //court concludes changing locks in secret is not peaceable
                IsPeaceableSelfHelpReentry = lp => !(lp is Wiley)
            };

            testResult = test.IsValid(new Berg(), new Wiley());
            Console.WriteLine(test.ToString());
            Assert.IsFalse(testResult);
        }
Пример #2
0
        public void RuckervWynn()
        {
            var lease = new Leasehold
            {
                SubjectProperty = new RealProperty("premises for a restaurant business")
                {
                    IsEntitledTo = lp => lp is Rucker
                },
                Inception = new DateTime(1990, 7, 1),
                Terminus  = new DateTime(1995, 7, 1)
            };

            var testResult = lease.IsValid(new Rucker(), new Wynn());

            Assert.IsTrue(testResult);

            var test = new Eviction(lease)
            {
                CurrentDateTime = new DateTime(1994, 1, 1),
                //late rent
                IsBreachLeaseCondition     = lp => lp is Wynn,
                IsResidenceHome            = p => false,
                IsPeaceableSelfHelpReentry = lp => lp is Rucker
            };

            testResult = test.IsValid(new Rucker(), new Wynn());
            Console.WriteLine(test.ToString());
            Assert.IsTrue(testResult);
        }
Пример #3
0
        public object Clone()
        {
            WriteBehind writeBehind = new WriteBehind();

            writeBehind.Mode         = Mode != null ? (string)Mode.Clone() : null;
            writeBehind.Throttling   = Throttling != null ? (string)Throttling.Clone() : null;
            writeBehind.Eviction     = Eviction != null ? (string)Eviction.Clone() : null;
            writeBehind.RequeueLimit = RequeueLimit != null ? (string)RequeueLimit.Clone() : null;
            writeBehind.BatchConfig  = BatchConfig != null?BatchConfig.Clone() as BatchConfig : null;

            return(writeBehind);
        }