Ejemplo n.º 1
0
        public void Create()
        {
            try
            {
                rt.srz.model.srz.SearchKey entity = CreateNew();

                object result = manager.Save(entity);

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

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

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

                rt.srz.model.srz.SearchKey entity = GetFirstSearchKey();

                manager.Delete(entity);

                entity = manager.GetById(entity.Id);
                Assert.IsNull(entity);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Ejemplo n.º 4
0
        public static SearchKey CreateNew(int depth = 0)
        {
            rt.srz.model.srz.SearchKey entity = new rt.srz.model.srz.SearchKey();

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

            entity.KeyValue = new System.Byte[] {};

            using (rt.srz.business.manager.IConceptManager conceptManager = ObjectFactory.GetInstance <IConceptManager>())
            {
                entity.DocumentUdlType = null;
            }

            using (rt.srz.business.manager.IInsuredPersonManager insuredPersonManager = ObjectFactory.GetInstance <IInsuredPersonManager>())
            {
                entity.InsuredPerson = null;
            }

            using (rt.srz.business.manager.IQueryResponseManager queryResponseManager = ObjectFactory.GetInstance <IQueryResponseManager>())
            {
                entity.QueryResponse = null;
            }

            using (rt.srz.business.manager.ISearchKeyTypeManager searchKeyTypeManager = ObjectFactory.GetInstance <ISearchKeyTypeManager>())
            {
                entity.KeyType = null;
            }

            using (rt.srz.business.manager.IStatementManager statementManager = ObjectFactory.GetInstance <IStatementManager>())
            {
                entity.Statement = null;
            }

            return(entity);
        }
Ejemplo n.º 5
0
        public void Update()
        {
            try
            {
                rt.srz.model.srz.SearchKey entityC = CreateNew();
                manager.Save(entityC);
                manager.Session.GetISession().Flush();
                manager.Session.GetISession().Clear();

                rt.srz.model.srz.SearchKey entityA = GetFirstSearchKey();

                entityA.KeyValue = new System.Byte[] {};

                manager.Update(entityA);

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

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