public void TestClassesFee_ExcemptClasses_NoPayments() { var user = new MemberUser { ExemptFromClassesFee = true }; var(status, fee) = user.GetClassesFee(); status.ShouldBe(FeeStatus.Unpayable); fee.ShouldBeNull(); }
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(); }
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(); } }
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(); }
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(); }
public void TestClassesFee_AlreadyPayed() { var user = new MemberUser { Payments = { MembershipPayment(), TrainingPayment(), ClassesPayment() } }; var(status, fee) = user.GetClassesFee(); status.ShouldBe(FeeStatus.Paid); fee.ShouldBeNull(); }
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(); }