Esempio n. 1
0
        public static DeadInfo CreateNew(int depth = 0)
        {
            rt.srz.model.srz.DeadInfo entity = new rt.srz.model.srz.DeadInfo();

            // You may need to maually enter this key if there is a constraint violation.
            entity.Id = System.Guid.NewGuid();

            entity.DateDead        = System.DateTime.Now;
            entity.ActRecordDate   = System.DateTime.Now;
            entity.ActRecordNumber = 63;

            return(entity);
        }
Esempio n. 2
0
        public void Create()
        {
            try
            {
                rt.srz.model.srz.DeadInfo entity = CreateNew();

                object result = manager.Save(entity);

                Assert.IsNotNull(result);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Esempio n. 3
0
        public void Read()
        {
            try
            {
                rt.srz.model.srz.DeadInfo entityA = CreateNew();
                manager.Save(entityA);

                rt.srz.model.srz.DeadInfo entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA, entityB);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Esempio n. 4
0
        public void Delete()
        {
            try
            {
                rt.srz.model.srz.DeadInfo entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.DeadInfo entity = GetFirstDeadInfo();

                manager.Delete(entity);

                entity = manager.GetById(entity.Id);
                Assert.IsNull(entity);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Esempio n. 5
0
        public void Update()
        {
            try
            {
                rt.srz.model.srz.DeadInfo entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.DeadInfo entityA = GetFirstDeadInfo();

                entityA.DateDead = System.DateTime.Now;

                manager.Update(entityA);

                rt.srz.model.srz.DeadInfo entityB = manager.GetById(entityA.Id);

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