public void GetMeetingCounts()
        {

            #region Arrange

            for (var i = 1; i <= 5; i++)
            {
                MeetingControllerTest.CreateWorkingMeeting(DateTime.Now.AddDays(-i), 1);
            }

            for (var i = 0; i < 5; i++)
            {
                MeetingControllerTest.CreateWorkingMeeting(DateTime.Now.AddDays(i), 1);
            }
            for (var i = 5; i < 10; i++)
            {
                MeetingControllerTest.CreateNoneWorkingMeeting(DateTime.Now.AddHours(i), 1);
            }

            #endregion

            #region Act

            var controller = ServiceLocator.Current.GetInstance<MeetingReportsController>();

            var pastCountReportDto = new MeetingReportDto { To = DateTime.Now };
            var pastMeetingCounts = controller.PutMeetingCounts(pastCountReportDto);

            var allCountReportDto = new MeetingReportDto();
            var allMeetingCounts = controller.PutMeetingCounts(allCountReportDto);

            var futureCountReportDto = new MeetingReportDto { From = DateTime.Now };
            var futureMeetingCounts = controller.PutMeetingCounts(futureCountReportDto);

            #endregion

            #region Assert

            Assert.AreEqual(6, pastMeetingCounts);
            Assert.AreEqual(9, futureMeetingCounts);
            Assert.AreEqual(15, allMeetingCounts);


            #endregion

        }
        public void GetMeetingByData()
        {
            #region Arrange

            for (var i = 1; i <= 5; i++)
            {
                MeetingControllerTest.CreateWorkingMeeting(DateTime.Now.AddDays(-i), 1);
            }

            #endregion

            #region Act

            var controller = ServiceLocator.Current.GetInstance<MeetingReportsController>();
            var reportDto = new MeetingReportDto { To = DateTime.Now };
            var meeting = controller.PutMeetingByDate(reportDto);

            #endregion

            #region Assert
            //Assert.AreEqual(5, meeting.Count());


            #endregion
        }
Exemplo n.º 3
0
 public List<MeetingWithDateDto> GetMeetingByDate(MeetingReportDto reportDto)
 {
     var userName = securityService.GetCurrentUserName();
     var res = reportRepository.GetMeetingByDate(reportDto.From, reportDto.To, userName);
     return res.Select(RMSMapper.Map<MeetingsWithDate, MeetingWithDateDto>).ToList();
 }
Exemplo n.º 4
0
 public int GetMeetingHours(MeetingReportDto meetingReportDto)
 {
     var userName = securityService.GetCurrentUserName();
     return reportRepository.GetAllMeetingHoursByDateTypeState(meetingReportDto.From, meetingReportDto.To,
          meetingReportDto.MeetingType, meetingReportDto.State, meetingReportDto.WithMinuts, meetingReportDto.WithAttachment, userName);
 }
 public List<MeetingWithDateDto> PutMeetingByDate(MeetingReportDto reportDto)
 {
     return meetingReportService.GetMeetingByDate(reportDto);
 }
 public int PutMeetingHours(MeetingReportDto meetingReportDto)
 {
     return meetingReportService.GetMeetingHours(meetingReportDto);
 }