Пример #1
0
        public void TestTrainingFee_ExcemptTraining_NoPayments()
        {
            var user = new MemberUser
            {
                ExemptFromTrainingFee = true
            };

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

            status.ShouldBe(FeeStatus.Unpayable);

            fee.ShouldBeNull();
        }
Пример #2
0
        public void TestTrainingFee_NoPayments()
        {
            var user = new MemberUser();

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

            status.ShouldBe(FeeStatus.Unpaid);

            fee.Description.ShouldBe("Medlemskap og treningsavgift");
            fee.Amount.ShouldBe(725);
            fee.AmountInCents.ShouldBe(725_00);
            fee.IncludesMembership.ShouldBeTrue();
            fee.IncludesTraining.ShouldBeTrue();
            fee.IncludesClasses.ShouldBeFalse();
        }
Пример #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();
            }
        }
Пример #4
0
        public void TestTrainingFee_AlreadyPayed()
        {
            var user = new MemberUser
            {
                Payments =
                {
                    MembershipPayment(),
                    TrainingPayment()
                }
            };

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

            status.ShouldBe(FeeStatus.Paid);

            fee.ShouldBeNull();
        }
Пример #5
0
        public void TestTrainingFee_MembershipPayed()
        {
            var user = new MemberUser
            {
                Payments =
                {
                    MembershipPayment()
                }
            };

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

            status.ShouldBe(FeeStatus.Unpaid);

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