Ejemplo n.º 1
0
        public void TestDatapiontRepositoryAddMethod()
        {
            NHUnitOfWork        nhUnitOfWork        = new NHUnitOfWork();
            DataPointRepository dataPointRepository = new DataPointRepository(nhUnitOfWork);

            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          = "20130725测试!"
            };

            dataPointRepository.Add(dataPoint);
        }
Ejemplo n.º 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();
        }