Example #1
0
        public void Should_Return_Kudos_Logs_For_Pie_Chart_With_Organization_Filter()
        {
            MockKudosLogsForPieChart();
            var result = _kudosService.GetKudosPieChartData(1, "UserId");

            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(3, result.First().Value);
        }
Example #2
0
        public IEnumerable <KudosPieChartSliceViewModel> KudosPieChartData(string userId = null)
        {
            if (userId == null)
            {
                userId = User.Identity.GetUserId();
            }

            var pieChartDto = _kudosService.GetKudosPieChartData(GetUserAndOrganization().OrganizationId, userId);
            var result      = _mapper.Map <IEnumerable <KudosPieChartSliceDto>, IEnumerable <KudosPieChartSliceViewModel> >(pieChartDto);

            return(result);
        }