public Property BabiesDoNotPayHo(PartyComposition partyComposition) { Func <bool> property = () => TripPriceCalculator.GetPrice(partyComposition) == TripPriceCalculator.GetPrice(RemoveBabies(partyComposition)); return(property.When(partyComposition.Babies != 0) .Classify(partyComposition.Children == 0, "Without children") .Classify(partyComposition.Children != 0, "With children")); }
public Property ChildrenPayLessThanAdults(PartyComposition partyComposition) { Func <bool> property = () => { var adultPrice = TripPriceCalculator.GetPrice(partyComposition) - TripPriceCalculator.GetPrice(RemoveAdultFrom(partyComposition)); var childPrice = TripPriceCalculator.GetPrice(partyComposition) - TripPriceCalculator.GetPrice(RemoveChildrenFrom(partyComposition)); return(adultPrice > childPrice); }; return(property.When(partyComposition.Adults > 2 && partyComposition.Children > 2)); }
public Property TripsCantBeForFree(PartyComposition partyComposition) { return((TripPriceCalculator.GetPrice(partyComposition) != 0).ToProperty()); }