| 3 | namespace Reputation; |
| 4 | |
| 5 | public static class ReputationHelper |
| 6 | { |
| 7 | private static int GetDelta(ReputationReason reason) => reason switch |
| 8 | { |
| 9 | ReputationReason.QuestionUpvoted => 5, |
| 10 | ReputationReason.AnswerUpvoted => 5, |
| 11 | ReputationReason.QuestionDownvoted => -2, |
| 12 | ReputationReason.AnswerDownvoted => -2, |
| 13 | _ => 15 |
| 14 | }; |
| 15 | |
| 16 | public static UserReputationChanged MakeEvent( |
| 17 | string userId, |
| 18 | ReputationReason reason, |
| 19 | string actorUserId, |
| 20 | DateTime? occurred = null) |
| 21 | => new( |
| 22 | UserId: userId, |
| 23 | Delta: GetDelta(reason), |
| 24 | Reason: reason, |
| 25 | ActorUserId: actorUserId, |
| 26 | Occurred: DateTime.UtcNow |
| 27 | ); |
| 28 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…