RecruitingTest
class has seven tests that ensure the correct functioning of User.ExpiredSubscriptions
property. Three of them are implemented already.
- Implement the
ExpiredSubscriptions
property inUser
class. A user has a list of subscriptions, which might contain expired ones. This property must return the number of expired subscriptions that the user has. Be aware that you can do any coding you need in both theSubscription
and theUser
classes to solve the exercise. - Implement the four remaining unit tests. For this, copy and paste the code located in any of the already existing tests. Remember that you will have to modify at most two lines of code to make the two unit tests fulfill their purpose. The method name suggests what needs to be corrected and instructs what the unit test is meant for. The already existing tests must not be modified. Assume that they are correct and will pass, provided the code you implement in
User.ExpiredSubscriptions
property is working as expected. - Assume that the expiration date of a subscription works similar to how credit/debit cards work (they expire the last day of the month). Example: a subscription has an expiration date of Jan 31, 2019. If the current date is Feb 14, 2019, this subscription is considered as expired.
- You are allowed to ask any questions regarding the structure of the code.
- Feel free to do any research that can be of aid to solve the exercise.
You have 15 minutes to complete the assignment.