Ejemplo n.º 1
0
        public void TestAmendmentIsValid()
        {
            var testSubject = new Amendment()
            {
                Court = new StateCourt("CA"),
                GetServiceOfProcess = lp => new VoluntaryEntry {
                    GetToDateOfService = lp1 => DateTime.UtcNow.AddDays(-14)
                },
                LinkedTo = new Complaint(),
            };

            var testResult = testSubject.IsValid(new ExamplePlaintiff(), new ExampleDefendant());

            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);


            testSubject = new Amendment()
            {
                Court = new StateCourt("CA"),
                GetServiceOfProcess = lp => new VoluntaryEntry {
                    GetToDateOfService = lp1 => DateTime.UtcNow.AddDays(-45)
                },
                LinkedTo = new Complaint(),
            };

            testResult = testSubject.IsValid(new ExamplePlaintiff(), new ExampleDefendant());
            Console.WriteLine(testSubject.ToString());
            Assert.IsFalse(testResult);
        }
Ejemplo n.º 2
0
        public void TestAmendmentIsValidWithLeave()
        {
            var testSubject = new Amendment()
            {
                Court = new StateCourt("CA"),
                GetServiceOfProcess = lp => new VoluntaryEntry {
                    GetToDateOfService = lp1 => DateTime.UtcNow.AddDays(-45)
                },
                LinkedTo = new Complaint(),
                //since its linked to a complaint (and not an answer), the opposition is the defense
                Assent = new Consent {
                    IsApprovalExpressed = lp => lp is IDefendant
                }
            };

            var testResult = testSubject.IsValid(new ExamplePlaintiff(), new ExampleDefendant());

            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);
        }