public GetAllDataPointsHistoryDataResponse GetAllDataPointsHistoryData() { GetAllDataPointsHistoryDataResponse response = new GetAllDataPointsHistoryDataResponse(); try { IEnumerable <DataPointHistoryData> dataPointHistoryDatas = dataPointHistoryDataRepository.FindAll(); response.DataPointHistoryDataView = dataPointHistoryDatas.ConvetToDataPointHistoryDataView(); } catch (Exception ex) { string message = "查询失败!错误信息:/n" + ex.Message; response = new GetAllDataPointsHistoryDataResponse() { ResponseSucceed = false, Message = "查询失败" }; LoggingFactory.GetLogger().WriteDebugLogger(message); return(response); } return(response); }
public void TestGetAllDataPointsHistoryData() { IUnitOfWork unitOfWork = new AdoUnitOfWork(); IDataPointRepository dataPointRepository = new DataPointRepository(unitOfWork); IDataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork); IModuleRepository moduleRepository = new ModuleRepository(unitOfWork); DataPointHistoryDataService dataPointHistoryDataService = new DataPointHistoryDataService(dataPointHistoryDataRepository, unitOfWork); GetAllDataPointsHistoryDataResponse response = new GetAllDataPointsHistoryDataResponse(); response = dataPointHistoryDataService.GetAllDataPointsHistoryData(); Assert.True(response.ResponseSucceed); }