public void TestMembershipFee_NoPayments() { var user = new MemberUser(); var(status, fee) = user.GetMembershipFee(); status.ShouldBe(FeeStatus.Unpaid); fee.Description.ShouldBe("Medlemskap"); fee.Amount.ShouldBe(300); fee.AmountInCents.ShouldBe(300_00); fee.IncludesMembership.ShouldBeTrue(); fee.IncludesTraining.ShouldBeFalse(); fee.IncludesClasses.ShouldBeFalse(); }
public void TestMembershipFee_AlreadyPayed() { var user = new MemberUser { Payments = { MembershipPayment() } }; var(status, fee) = user.GetMembershipFee(); status.ShouldBe(FeeStatus.Paid); fee.ShouldBeNull(); }
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(); } }