コード例 #1
0
        public void TestAddDataPointHistoryData()
        {
            IUnitOfWork unitOfWork = new AdoUnitOfWork();
            IDataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork);

            DataPointHistoryDataService dataPointHistoryDataService
                = new DataPointHistoryDataService(dataPointHistoryDataRepository,
                                                  unitOfWork);

            List <DataPointHistoryData> dataPointHistoryDatas = new List <DataPointHistoryData>();

            for (int i = 0; i < 5000; i++)
            {
                DataPointHistoryData dataPointHistoryData = new DataPointHistoryData()
                {
                    Id        = Guid.NewGuid().ToString("D"),
                    DataPoint = new DataPoint()
                    {
                        Id = 1726
                    },
                    DateTime = DateTime.Now,
                    Value    = 123456789.12345
                };

                dataPointHistoryDatas.Add(dataPointHistoryData);
            }

            AddDataPointHistoryDataRequst requst = new AddDataPointHistoryDataRequst();

            requst.DataPointHistoryDatasToAdd = dataPointHistoryDatas;

            AddDataPointHistoryDataResponse response =
                dataPointHistoryDataService.AddDataPointHistoryData(requst);
        }
コード例 #2
0
        public void TestInitializeTimer()
        {
            IUnitOfWork unitOfWork = new AdoUnitOfWork();
            IDataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork);

            DataPointHistoryDataService dataPointHistoryDataService
                = new DataPointHistoryDataService(dataPointHistoryDataRepository,
                                                  unitOfWork);

            //dataPointHistoryDataService.DelecteDataPointHistoryValue();
        }
コード例 #3
0
        public void TestDelecteDataPointHistoryValue()
        {
            IUnitOfWork unitOfWork = new AdoUnitOfWork();
            IDataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork);

            DataPointHistoryDataService dataPointHistoryDataService
                = new DataPointHistoryDataService(dataPointHistoryDataRepository,
                                                  unitOfWork);

            dataPointHistoryDataService.DelecteDataPointHistoryValueBefore(0);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public void TestRemoveDataPointHistoryDataByQuery()
        {
            IUnitOfWork unitOfWork = new AdoUnitOfWork();
            IDataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork);

            DataPointHistoryDataService dataPointHistoryDataService
                = new DataPointHistoryDataService(dataPointHistoryDataRepository,
                                                  unitOfWork);

            DeleteDataPointHistoryDataRequst requst = new DeleteDataPointHistoryDataRequst();

            requst.BeginTime = new DateTime(2013, 8, 3);
            requst.EndTime   = DateTime.Now;

            DeleteDataPointHistoryDataResponse response =
                dataPointHistoryDataService.DeleteDataPointHistoryData(requst);

            Assert.IsTrue(response.ResponseSucceed);
        }
コード例 #6
0
        public void TestGetDataPiontHistoryData()
        {
            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);

            GetDataPointHistoryDataRequest  request  = new GetDataPointHistoryDataRequest();
            GetDataPiontHistoryDataResponse response = new GetDataPiontHistoryDataResponse();

            request.DataPointId = 1;
            request.BeginTime   = new DateTime();
            request.EndTime     = DateTime.Now;

            response = dataPointHistoryDataService.GetDataPiontHistoryData(request);

            Assert.True(response.ResponseSucceed);
        }