public static KnowledgeLicense Update(KnowledgeLicense knowledgeLicense, KnowledgeQualities knowledgeQuality) { if (IsEasyButEarlyToRepeat(knowledgeLicense, knowledgeQuality)) { knowledgeQuality = KnowledgeQualities.StillRemember; } return(KnowledgeLicenseProviders[knowledgeQuality].Grant(knowledgeLicense)); }
private static bool IsNotGrantingTime(KnowledgeLicense knowledgeLicense) { return(knowledgeLicense.RepeatTime > DateTime.UtcNow.AddDays(DAYS_GRANTING_TIMESPAN)); }
private static bool IsEasyButEarlyToRepeat(KnowledgeLicense knowledgeLicense, KnowledgeQualities knowledgeQuality) { return(knowledgeQuality.Equals(KnowledgeQualitys.EasyToRemember) && IsNotGrantingTime(knowledgeLicense)); }