Ejemplo n.º 1
0
        public static Im CreateNew(int depth = 0)
        {
            rt.atl.model.atl.Im entity = new rt.atl.model.atl.Im();


            entity.Caption = "Test Test Test Test Test Test Tes";
            entity.W       = 81;

            return(entity);
        }
Ejemplo n.º 2
0
        public void Create()
        {
            try
            {
                rt.atl.model.atl.Im entity = CreateNew();

                object result = manager.Save(entity);

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

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

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

                rt.atl.model.atl.Im entity = GetFirstIm();

                manager.Delete(entity);

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

                rt.atl.model.atl.Im entityA = GetFirstIm();

                entityA.Caption = "Test Test Test";

                manager.Update(entityA);

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

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