public void GetUserExperienceHourDetails(HoursViewColumns sortColumn) { //Arrange var gridConditions = new GridConditions(); var filterConditions = new HoursViewFilterConditions(); var filterOperands = new HoursViewFilterOperands(); //Grid conditions gridConditions.SortColumn = sortColumn.ToString(); gridConditions.SortDirection = "ASC"; gridConditions.TimezoneOffset = 0; gridConditions.StartRow = 1; gridConditions.EndRow = 25; //Filter conditions filterConditions.Search = ""; filterConditions.Workspace = ""; //Filter operands filterOperands.TotalRunTime = FilterOperand.Equals; filterOperands.AverageRunTime = FilterOperand.Equals; filterOperands.TotalRuns = FilterOperand.Equals; //Page-level filters gridConditions.StartDate = DateTime.Now.AddYears(-1); gridConditions.EndDate = DateTime.Now.AddDays(1); //Act var result = this.reportRepository.GetUserExperienceHourDetails(gridConditions, filterConditions, filterOperands); //Assert Assert.That(result, Is.Not.Null); Assert.That(result, Is.Not.Empty); }
public UserExperienceHoursViewModel() { GridConditions = new GridConditions(); FilterConditions = new HoursViewFilterConditions(); FilterOperands = new HoursViewFilterOperands(); }
public virtual HoursViewGrid WorkspaceSearches(GridConditions gridConditions, HoursViewFilterConditions filterConditions, HoursViewFilterOperands filterOperands) { var grid = new HoursViewGrid(); var dt = this.reportRepository.GetUserExperienceHourDetails(gridConditions, filterConditions, filterOperands); if (dt.Count > 1) { var searchUsers = dt[0]; grid.Data = (from DataRow d in searchUsers.Rows select new UserExperienceWorkspaceHourInfo { Index = d.Field <Int64>("RowNumber"), Workspace = d.Field <string>("DatabaseName"), SearchId = d.Field <int>("SearchArtifactId"), Search = d.Field <string>("SearchName"), TotalRunTime = d.Field <int?>("TotalRunTime").GetValueOrDefault(0), AverageRunTime = d.Field <int?>("AverageRunTime").GetValueOrDefault(0), TotalRuns = d.Field <int?>("TotalRuns").GetValueOrDefault(0), IsComplex = d.Field <bool?>("IsComplex").GetValueOrDefault(false), SummaryDayHour = d.Field <DateTime>("SummaryDayHour"), IsActiveWeeklySample = d.Field <bool>("IsActiveArrivalRateSample") }).AsQueryable(); var resultInfo = dt[1]; grid.Count = resultInfo.Rows.Count > 0 ? resultInfo.Rows[0].Field <int?>("FilteredCount").GetValueOrDefault(0) : 0; } return(grid); }