Exemplo n.º 1
0
        public void TestClassesFee_ExcemptClasses_NoPayments()
        {
            var user = new MemberUser
            {
                ExemptFromClassesFee = true
            };

            var(status, fee) = user.GetClassesFee();

            status.ShouldBe(FeeStatus.Unpayable);

            fee.ShouldBeNull();
        }
Exemplo n.º 2
0
        public void TestClassesFee_NoPayments()
        {
            var user = new MemberUser();

            var(status, fee) = user.GetClassesFee();

            status.ShouldBe(FeeStatus.Unpaid);

            fee.Description.ShouldBe("Medlemskap og kursavgift");
            fee.Amount.ShouldBe(1200);
            fee.AmountInCents.ShouldBe(1200_00);
            fee.IncludesMembership.ShouldBeTrue();
            fee.IncludesTraining.ShouldBeTrue();
            fee.IncludesClasses.ShouldBeTrue();
        }
Exemplo n.º 3
0
        public static (FeeStatus FeeStatus, Fee Fee) GetFee(this MemberUser user, string key)
        {
            switch (key)
            {
            case Fee.Membership:
                return(user.GetMembershipFee());

            case Fee.Training:
                return(user.GetTrainingFee());

            case Fee.Classes:
                return(user.GetClassesFee());

            default:
                throw new Exception();
            }
        }
Exemplo n.º 4
0
        public void TestClassesFee_ExcemptTrainingAndClasses_MembershipPayed()
        {
            var user = new MemberUser
            {
                ExemptFromTrainingFee = true,
                ExemptFromClassesFee  = true,
                Payments =
                {
                    MembershipPayment()
                }
            };

            var(status, fee) = user.GetClassesFee();

            status.ShouldBe(FeeStatus.Paid);

            fee.ShouldBeNull();
        }
Exemplo n.º 5
0
        public void TestClassesFee_ExcemptTraining_NoPayments()
        {
            var user = new MemberUser
            {
                ExemptFromTrainingFee = true
            };

            var(status, fee) = user.GetClassesFee();

            status.ShouldBe(FeeStatus.Unpaid);

            fee.Description.ShouldBe("Medlemskap og kursavgift");
            fee.Amount.ShouldBe(775);
            fee.AmountInCents.ShouldBe(775_00);
            fee.IncludesMembership.ShouldBeTrue();
            fee.IncludesTraining.ShouldBeFalse();
            fee.IncludesClasses.ShouldBeTrue();
        }
Exemplo n.º 6
0
        public void TestClassesFee_AlreadyPayed()
        {
            var user = new MemberUser
            {
                Payments =
                {
                    MembershipPayment(),
                    TrainingPayment(),
                    ClassesPayment()
                }
            };

            var(status, fee) = user.GetClassesFee();

            status.ShouldBe(FeeStatus.Paid);

            fee.ShouldBeNull();
        }
Exemplo n.º 7
0
        public void TestClassesFee_MembershipPayed()
        {
            var user = new MemberUser
            {
                Payments =
                {
                    MembershipPayment()
                }
            };

            var(status, fee) = user.GetClassesFee();

            status.ShouldBe(FeeStatus.Unpaid);

            fee.Description.ShouldBe("Kursavgift");
            fee.Amount.ShouldBe(900);
            fee.AmountInCents.ShouldBe(900_00);
            fee.IncludesMembership.ShouldBeFalse();
            fee.IncludesTraining.ShouldBeTrue();
            fee.IncludesClasses.ShouldBeTrue();
        }