public void CheckMessage() { var current = CheckPoint.Current(); var score = new CycleScore(current.Cycle, DateTimeOffset.Now.Ticks); var updater = new Mock <ICycleScoreUpdater>().Object; score.SetScore(1, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); score.SetScore(2, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); score.SetScore(3, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); score.SetScore(4, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); score.SetScore(5, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); score.SetScore(6, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); score.SetScore(7, new UpdateScore { EnlightenedScore = 1000, ResistanceScore = 0 }, updater); Console.WriteLine(score.ToString()); }
private void PostToSlack(CycleScore currentCycle) { IRestResponse response; if (currentCycle.HasMissingCPs()) { var missingCPs = currentCycle.MissingCPs(); //http://localhost:31790/#/6/1 var missingMessages = missingCPs.Select(cp => string.Format("Missing CP {2}. Goto http://{0}/#/{1}/{2} to update the score", Request.RequestUri.Host.ToLower(), currentCycle.Cycle.Id, cp.Cp)).ToList(); response = _slackSender.Send(string.Join("\n", missingMessages)); } else { response = _slackSender.Send(currentCycle.ToString()); } if (response.StatusCode != HttpStatusCode.OK) { throw new HttpException((int)response.StatusCode, "Error Sending To Slack. " + response.ErrorMessage); } }