Esempio n. 1
0
        public bool TestMustPayMembersPrice(int price, bool hasPaidMembership)
        {
            var options = new EventSignupOptions
            {
                PriceForMembers = price
            };

            var user = new User
            {
                Payments =
                {
                    Payment(membership: hasPaidMembership)
                }
            };

            return(user.MustPayMembersPrice(options));
        }
Esempio n. 2
0
        public bool TestMustPayMembersFee(bool requiresMembership, bool hasPaidMembership)
        {
            var options = new EventSignupOptions
            {
                RequiresMembershipFee = requiresMembership
            };

            var user = new User
            {
                Payments =
                {
                    Payment(membership: hasPaidMembership)
                }
            };

            return(user.MustPayMembershipFee(options));
        }
Esempio n. 3
0
        public bool TestMembershipIncludedInTrainingFee(bool includedInTrainingFee, bool hasPaidTrainingFee)
        {
            var options = new EventSignupOptions
            {
                IncludedInTrainingFee = includedInTrainingFee,
                PriceForMembers       = 100
            };

            var user = new User
            {
                Payments =
                {
                    Payment(training: hasPaidTrainingFee, membership: true)
                }
            };

            return(user.MustPayMembersPrice(options));
        }
Esempio n. 4
0
        public bool TestNonMembershipIncludedInClassesFee(bool includedInClassesFee, bool hasPaidClassesFee)
        {
            var options = new EventSignupOptions
            {
                IncludedInClassesFee = includedInClassesFee,
                PriceForNonMembers   = 100
            };

            var user = new User
            {
                Payments =
                {
                    Payment(classes: hasPaidClassesFee)
                }
            };

            return(user.MustPayNonMembersPrice(options));
        }
Esempio n. 5
0
        public bool TestMustPayClassesFee(bool requiresClassesFee, bool hasPaidClassesFee, bool exemptFromClassesFee)
        {
            var options = new EventSignupOptions
            {
                RequiresClassesFee = requiresClassesFee
            };

            var user = new User
            {
                ExemptFromClassesFee = exemptFromClassesFee,
                Payments             =
                {
                    Payment(classes: hasPaidClassesFee)
                }
            };

            return(user.MustPayClassesFee(options));
        }
Esempio n. 6
0
        public bool TestMustPayTrainingFee(bool requiresTrainingFee, bool hasPaidTrainingFee, bool exemptFromTrainingFee)
        {
            var options = new EventSignupOptions
            {
                RequiresTrainingFee = requiresTrainingFee
            };

            var user = new User
            {
                ExemptFromTrainingFee = exemptFromTrainingFee,
                Payments =
                {
                    Payment(training: hasPaidTrainingFee)
                }
            };

            return(user.MustPayTrainingFee(options));
        }
Esempio n. 7
0
 public static bool MustPayClassesFee(this MemberUser user, EventSignupOptions options)
 => options.RequiresClassesFee && !user.HasPayedClassesFeeThisSemester() && !user.ExemptFromClassesFee;
Esempio n. 8
0
 public static bool MustPayTrainingFee(this MemberUser user, EventSignupOptions options)
 => options.RequiresTrainingFee && !user.HasPayedTrainingFeeThisSemester() && !user.ExemptFromTrainingFee;
Esempio n. 9
0
 public static bool MustPayMembershipFee(this MemberUser user, EventSignupOptions options)
 => options.RequiresMembershipFee && !user.HasPayedMembershipThisYear();
Esempio n. 10
0
 public static bool MustPayMembersPrice(this MemberUser user, EventSignupOptions options)
 => options.PriceForMembers > 0 && user.HasPayedMembershipThisYear();