コード例 #1
0
        public void Create()
        {
            try
            {
                rt.atl.model.atl.Testproc entity = CreateNew();

                object result = manager.Save(entity);

                Assert.IsNotNull(result);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
コード例 #2
0
        public void Read()
        {
            try
            {
                rt.atl.model.atl.Testproc entityA = CreateNew();
                manager.Save(entityA);

                rt.atl.model.atl.Testproc entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA, entityB);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
コード例 #3
0
        public static Testproc CreateNew(int depth = 0)
        {
            rt.atl.model.atl.Testproc entity = new rt.atl.model.atl.Testproc();


            entity.Dedit    = System.DateTime.Now;
            entity.Caption  = "Test Test ";
            entity.Code     = "123";
            entity.Strong   = true;
            entity.Act      = true;
            entity.Srv      = true;
            entity.Procname = "Test Test Te";
            entity.Nosrop   = true;
            entity.Flds     = "T";

            return(entity);
        }
コード例 #4
0
        public void Delete()
        {
            try
            {
                rt.atl.model.atl.Testproc entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.atl.model.atl.Testproc entity = GetFirstTestproc();

                manager.Delete(entity);

                entity = manager.GetById(entity.Id);
                Assert.IsNull(entity);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
コード例 #5
0
        public void Update()
        {
            try
            {
                rt.atl.model.atl.Testproc entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.atl.model.atl.Testproc entityA = GetFirstTestproc();

                entityA.Dedit = System.DateTime.Now;

                manager.Update(entityA);

                rt.atl.model.atl.Testproc entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA.Dedit, entityB.Dedit);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }