private static SolutionAnalysis DisapproveWhenInvalid(this GigasecondSolution gigasecondSolution) { if (gigasecondSolution.CreatesNewDatetime()) { return(gigasecondSolution.DisapproveWithComment(DontCreateDateTime)); } if (gigasecondSolution.DoesNotUseAddSeconds()) { return(gigasecondSolution.DisapproveWithComment(UseAddSeconds)); } return(null); }
private static SolutionAnalysis Analyze(GigasecondSolution gigasecondSolution) { if (gigasecondSolution.ReturnsAddSecondsWithScientificNotation()) { return(gigasecondSolution.UsesExpressionBody() ? gigasecondSolution.ApproveAsOptimal() : gigasecondSolution.ApproveWithComment(SharedComments.UseExpressionBodiedMember)); } if (gigasecondSolution.ReturnsAddSecondsWithMathPow()) { return(gigasecondSolution.ApproveWithComment(GigasecondComments.UseScientificNotationNotMathPow)); } if (gigasecondSolution.ReturnsAddSecondsWithDigitsWithoutSeparator()) { return(gigasecondSolution.ApproveWithComment(GigasecondComments.UseScientificNotationOrDigitSeparators)); } if (gigasecondSolution.UsesAddMethod() || gigasecondSolution.UsesPlusOperator()) { return(gigasecondSolution.DisapproveWithComment(GigasecondComments.UseAddSeconds)); } return(gigasecondSolution.ReferToMentor()); }