public void TestDatapiontRepositoryRemoveMethod_RemovingEntityFromISessionButNotFormDataBase()
        {
            NHUnitOfWork        nhUnitOfWork        = new NHUnitOfWork();
            DataPointRepository dataPointRepository = new DataPointRepository(nhUnitOfWork);

            DataPoint dataPointPre = dataPointRepository.FindBy(15);

            if (dataPointPre != null)
            {
                dataPointRepository.Remove(dataPointPre);
            }

            DataPoint dataPointAfter = dataPointRepository.FindBy(15);

            Assert.IsNull(dataPointAfter);
        }
        public void TestDatapiontRepositoryRemoveMethod_BothRemovingEntityForISessionAndemoveFormDataBase()
        {
            NHUnitOfWork        nhUnitOfWork        = new NHUnitOfWork();
            DataPointRepository dataPointRepository = new DataPointRepository(nhUnitOfWork);

            DataPoint dataPointPre = dataPointRepository.FindBy(15);

            if (dataPointPre != null)
            {
                dataPointRepository.Remove(dataPointPre);
            }

            //如果不调用nhUnitOfWork.Commit(),就会:
            //只是在ISession中删除,但是没有在数据库中删除
            //测试方法:
            //在Commit前后分别查看数据库的变化
            nhUnitOfWork.Commit();

            DataPoint dataPointAfter = dataPointRepository.FindBy(15);

            Assert.IsNull(dataPointAfter);
        }