public void CanAddDataPointHistoryData()
        {
            AdoUnitOfWork unitOfWork = new AdoUnitOfWork();
            DataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork);

            DataPointHistoryData dataPointHistoryData = new DataPointHistoryData()
            {
                Id        = Guid.NewGuid().ToString("D"),
                DataPoint = new DataPoint()
                {
                    Id = 1726
                },
                DateTime = DateTime.Now.AddDays(8),
                Value    = 123456789.12345
            };

            dataPointHistoryDataRepository.Add(dataPointHistoryData);
            unitOfWork.Commit();
        }
예제 #2
0
        public void CanAddDataPoint()
        {
            AdoUnitOfWork       unitOfWork          = new AdoUnitOfWork();
            DataPointRepository dataPointRepository = new DataPointRepository(unitOfWork);

            Random seed      = new Random();
            Random randomNum = new Random(seed.Next());

            DataPoint dataPoint = new DataPoint()
            {
                Number = randomNum.Next(1000),
                Name   = "35#",
                StartRegisterAddress = 12,
                DataType             = DataType.Bit,
                Description          = "20130801测试!"
            };

            dataPointRepository.Add(dataPoint);
            unitOfWork.Commit();
        }