Esempio n. 1
0
        public override bool IsValid(params ILegalPerson[] persons)
        {
            if (Affidavit == null)
            {
                AddReasonEntry($"{nameof(Affidavit)} is unassigned");
                return(false);
            }

            if (IsInvalidOnItsFace(Affidavit))
            {
                AddReasonEntry($"{nameof(IsInvalidOnItsFace)} is true");
                return(false);
            }

            if (!IsContainFalseStatement(Affidavit))
            {
                AddReasonEntry($"{nameof(IsContainFalseStatement)} is false");
                return(false);
            }

            var affiant = Affidavit.GetAffiant(persons);

            if (affiant == null)
            {
                AddReasonEntry($"{nameof(Affidavit)} {nameof(Affidavit.GetAffiant)} returned nothing");
                return(false);
            }

            var affiantTitle = affiant.GetLegalPersonTypeName();

            if (!IsAffiantLawEnforcement(affiant))
            {
                AddReasonEntry($"{affiantTitle} {affiant.Name}, {nameof(IsAffiantLawEnforcement)} is false");
                return(false);
            }

            if (!IsDisregardOfTruth(affiant))
            {
                AddReasonEntry($"{affiantTitle} {affiant.Name}, {nameof(IsDisregardOfTruth)} is false");
                return(false);
            }

            if (!IsFalseStatementCritical(Affidavit))
            {
                AddReasonEntry($"{nameof(IsFalseStatementCritical)} is false");
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        public Affidavit GetAffidavitDetails(string affidavitNo)
        {
            Affidavit result = new Affidavit();

            try
            {
                result = affidavitLogic.GetAffidavitDetails_SWP(long.Parse(affidavitNo));
                Log.Info(ConfigurationManager.ConnectionStrings["SWPostEntities"]);
                Log.Info(ConfigurationManager.ConnectionStrings["SidewalkConnection"]);
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
            }
            return(result);
        }
Esempio n. 3
0
        public void TestAffidavitIsValid()
        {
            var testSubject = new Affidavit <object>
            {
                GetAffiant   = lps => lps.FirstOrDefault(lp => lp is ExampleAffiant),
                GetWitness   = lps => lps.FirstOrDefault(lp => lp is ExampleNotaryPublic),
                IsSigned     = lp => lp is ExampleNotaryPublic || lp is ExampleAffiant,
                Attestation  = new Tuple <IVoca, DateTime?>(new VocaBase("office"), DateTime.UtcNow),
                FactsThereof = new List <object> {
                    new object()
                }
            };

            var testResult = testSubject.IsValid(new ExampleAffiant(), new ExampleNotaryPublic());

            Assert.IsTrue(testResult);
        }