Exemple #1
0
        public void ExampleRelianceTest()
        {
            var testCrime = new Misdemeanor
            {
                ActusReus = new ByDeception
                {
                    SubjectProperty   = new ActOfService("TUNE-UP SERVICE"),
                    IsFalseImpression = lp => lp is JeremyTheifEg,
                    IsAcquiredTitle   = lp => lp is JeremyTheifEg
                },
                MensRea = new Purposely
                {
                    IsKnowledgeOfWrongdoing = lp => lp is JeremyTheifEg,
                    IsIntentOnWrongdoing    = lp => lp is JeremyTheifEg
                }
            };
            //chuck was aware of the deception and attempted to use is for extortion
            var testReliance = new Reliance
            {
                IsReliantOnFalseRepresentation = lp => lp is ChuckUnrelianceEg
            };

            testCrime.AttendantCircumstances.Add(testReliance);

            var testResult = testCrime.IsValid(new JeremyTheifEg(), new ChuckUnrelianceEg());

            Console.WriteLine(testCrime.ToString());
            Assert.IsTrue(testResult);
        }
        public void MistletoevLocke()
        {
            var testContract = new ComLawContract <Promise>
            {
                Offer      = new OfferDeliveryService(),
                Acceptance = o => o is OfferDeliveryService ? new AcceptanctDeliveryService() : null,
                Assent     = new MutualAssent
                {
                    IsApprovalExpressed = lp => true,
                    TermsOfAgreement    = lp =>
                    {
                        switch (lp)
                        {
                        case Mistletoe _:
                            return(((Mistletoe)lp).GetTerms());

                        case Locke _:
                            return(((Locke)lp).GetTerms());

                        default:
                            return(null);
                        }
                    }
                }
            };

            testContract.Consideration = new Consideration <Promise>(testContract)
            {
                IsGivenByOfferee  = (lp, p) => true,
                IsSoughtByOfferor = (lp, p) => true
            };

            var testResult = testContract.IsValid(new Mistletoe(), new Locke());

            Assert.IsTrue(testResult);

            var testSubject = new Reliance <Promise>(testContract)
            {
                CalcPrepExpenditures = lp =>
                {
                    var locke = lp as Locke;
                    if (locke == null)
                    {
                        return(0m);
                    }

                    return(locke.AmountOfTheLoan - locke.AmountRecoveredFromVehicleSales + locke.CostOfDirtWork +
                           locke.LossFromMaterialsOfRamp);
                }
            };

            testResult = testSubject.IsValid(new Mistletoe(), new Locke());
            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);
        }
Exemple #3
0
        public void HollywoodFanvGabor()
        {
            var testContract = new ComLawContract <Promise>
            {
                Offer      = new OfferMakeAppearance(),
                Acceptance = o => o is OfferMakeAppearance ? new AcceptanctMakeAppearance() : null,
                Assent     = new MutualAssent
                {
                    IsApprovalExpressed = lp => true,
                    TermsOfAgreement    = lp =>
                    {
                        switch (lp)
                        {
                        case HollywoodFan _:
                            return(((HollywoodFan)lp).GetTerms());

                        case Gabor _:
                            return(((Gabor)lp).GetTerms());

                        default:
                            return(null);
                        }
                    }
                }
            };

            testContract.Consideration = new Consideration <Promise>(testContract)
            {
                IsGivenByOfferee  = (lp, p) => true,
                IsSoughtByOfferor = (lp, p) => true
            };

            var testResult = testContract.IsValid(new HollywoodFan(), new Gabor());

            Assert.IsTrue(testResult);

            var testSubject = new Reliance <Promise>(testContract)
            {
                CalcPrepExpenditures = lp => (lp as HollywoodFan)?.TotalExpense ?? 0m
            };

            testResult = testSubject.IsValid(new HollywoodFan(), new Gabor());
            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);
        }
        public void SullivanvOconnor()
        {
            var testContract = new ComLawContract <Promise>
            {
                Offer      = new OfferNoseJob(),
                Acceptance = o => o is OfferNoseJob ? new AcceptanctNoseJob() : null,
                Assent     = new MutualAssent
                {
                    IsApprovalExpressed = lp => true,
                    TermsOfAgreement    = lp =>
                    {
                        switch (lp)
                        {
                        case Sullivan _:
                            return(((Sullivan)lp).GetTerms());

                        case Oconnor _:
                            return(((Oconnor)lp).GetTerms());

                        default:
                            return(null);
                        }
                    }
                }
            };

            testContract.Consideration = new Consideration <Promise>(testContract)
            {
                IsGivenByOfferee  = (lp, p) => true,
                IsSoughtByOfferor = (lp, p) => true
            };
            var testResult = testContract.IsValid(new Sullivan(), new Oconnor());

            Assert.IsTrue(testResult);

            var testSubject = new Reliance <Promise>(testContract)
            {
                CalcPrepExpenditures = lp => lp is Sullivan ? 2m : 0m,
                CalcLossAvoided      = lp => lp is Sullivan ? 1m : 0m,
            };

            testResult = testSubject.IsValid(new Sullivan(), new Oconnor());
            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);
        }
        public void DoeringvJohnDeere()
        {
            var testContract = new ComLawContract <Promise>
            {
                Offer      = new OfferActAsDistributor(),
                Acceptance = o => o is OfferActAsDistributor ? new AcceptanctActAsDistributor() : null,
                Assent     = new MutualAssent
                {
                    IsApprovalExpressed = lp => true,
                    TermsOfAgreement    = lp =>
                    {
                        switch (lp)
                        {
                        case Doering _:
                            return(((Doering)lp).GetTerms());

                        case JohnDeere _:
                            return(((JohnDeere)lp).GetTerms());

                        default:
                            return(null);
                        }
                    }
                }
            };

            testContract.Consideration = new Consideration <Promise>(testContract)
            {
                IsGivenByOfferee  = (lp, p) => true,
                IsSoughtByOfferor = (lp, p) => true
            };

            var testResult = testContract.IsValid(new Doering(), new JohnDeere());

            Assert.IsTrue(testResult);

            var testSubject = new Reliance <Promise>(testContract)
            {
            };

            testResult = testSubject.IsValid(new Doering(), new JohnDeere());
            Console.WriteLine(testSubject.ToString());
            Assert.IsFalse(testResult);
        }
Exemple #6
0
        public async Task <IActionResult> UpdateInstituteProfile([FromBody] InstituteDTO institute)
        {
            var data = mapper.Map <InstituteDTO, Institute>(institute);

            data.UserId = UserIdRequested();
            var dataInserted = await unitOfWork.GetRepository <Institute>().InsertAsync(data);

            foreach (var item in institute.Reliance)
            {
                var relianceItem = new Reliance()
                {
                    InstituteId      = dataInserted.Id,
                    Logo             = item.Logo,
                    RelianceStatusId = item.Status,
                    Name             = item.Name,
                };
                await unitOfWork.GetRepository <Reliance>().InsertAsync(relianceItem);
            }

            return(ApiResponder.RespondSuccessTo(HttpStatusCode.Ok, dataInserted));
        }
Exemple #7
0
        public void PeoplevTraster()
        {
            //sneaky bastard, a consultant, tricked companies into thinking
            // they needed MS licx, pretends to purchase them from phoney
            // supplier then fakes the any actual docx

            var testCriminalAct = new ByDeception
            {
                IsFalseImpression = lp => lp is Traster,
                IsTakenPossession = lp => lp is Traster,
                SubjectProperty   = new MsLicx()
            };

            var testCrime = new Felony
            {
                ActusReus = testCriminalAct,
                MensRea   = new Purposely
                {
                    IsIntentOnWrongdoing = lp => lp is Traster
                }
            };

            var reliance = new Reliance
            {
                IsReliantOnFalseRepresentation =
                    lp => lp is DemlerArmstrongAndRowlandLawFirm || lp is DemennoKerdoonCompany
            };

            testCrime.AttendantCircumstances.Add(reliance);
            var testResult = testCrime.IsValid(new Traster(), new DemlerArmstrongAndRowlandLawFirm(),
                                               new DemennoKerdoonCompany());

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

            //this is larceny by trick since the MS Licx titles where still due
            Assert.IsTrue(testCriminalAct.IsLarcenyByTrick);
        }