Пример #1
0
        public void all_time_stats_for_zero_previous_sessions_returns_zeros()
        {
            AllTimeStatsCalculator calc = new AllTimeStatsCalculator(_user);
            var speedCalcs = calc.GetSpeedAllTime();

            Assert.That(speedCalcs, Is.Null);

            var accuracyCalcs = calc.GetAccuracyAllTime();

            Assert.That(accuracyCalcs, Is.Null);
        }
Пример #2
0
        public HttpResponseMessage HistoryDetails([FromBody] JObject data)
        {
            JWTToken token = data["token"].ToObject <JWTToken>();
            string   seqId = data["sequenceId"].ToString();

            Data.KCUser user = new Data.KCUser()
            {
                UserId = Guid.Parse(token.UserId)
            };
            var userMgr = new KeyCdr.History.UserSessionHistory();

            Data.KeySequence detail = userMgr.GetHistoryDetailsByKeySequence(Guid.Parse(seqId));

            AllTimeStatsCalculator  allTimeStats = new AllTimeStatsCalculator(user);
            UserHistoryDetailsModel result       = UserHistoryDetailsModel.Create(detail);

            result.AnalysisSpeedAllTime    = allTimeStats.GetSpeedAllTime();
            result.AnalysisAccuracyAllTime = allTimeStats.GetAccuracyAllTime();

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }