Ejemplo n.º 1
0
        public void ColemanvSoccerAssnofColumbia()
        {
            var test = new ContributoryNegligence <SoccerFieldActivity>(ExtensionMethods.Tortfeasor)
            {
                GetContribution = lp =>
                {
                    if (lp is Coleman)
                    {
                        return(new SoccerFieldActivity(1));
                    }
                    if (lp is SoccerAssnofColumbia)
                    {
                        return(new SoccerFieldActivity(10));
                    }
                    return(new SoccerFieldActivity(0));
                }
            };

            var testResult = test.IsValid(new Coleman(), new SoccerAssnofColumbia());

            Assert.IsFalse(testResult);
            Console.WriteLine(test.ToString());
        }
Ejemplo n.º 2
0
        public void LandingsAssociationIncvGwynethWilliams()
        {
            var test = new ContributoryNegligence <Walking>(ExtensionMethods.Tortfeasor)
            {
                GetContribution = lp =>
                {
                    if (lp is GwynethWilliams)
                    {
                        return(new Walking(1));
                    }
                    if (lp is LandingsAssociationInc)
                    {
                        return(new Walking(10));
                    }
                    return(new Walking(0));
                }
            };

            var testResult = test.IsValid(new LandingsAssociationInc(), new GwynethWilliams());

            Assert.IsFalse(testResult);

            Console.WriteLine(test.ToString());
        }
        public void MurphyvSteeplechaseAmusementCo()
        {
            var test = new ContributoryNegligence <AmusementRide>(ExtensionMethods.Tortfeasor)
            {
                GetContribution = lp =>
                {
                    if (lp is SteeplechaseAmusementCo)
                    {
                        return(new AmusementRide(1));
                    }
                    if (lp is Murphy)
                    {
                        return(new AmusementRide(1));
                    }
                    return(new AmusementRide(0));
                }
            };

            var testResult = test.IsValid(new Murphy(), new SteeplechaseAmusementCo());

            Assert.IsFalse(testResult);

            Console.WriteLine(test.ToString());
        }