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


            entity.StatementId = "Test Test T";
            entity.IsExport    = true;
            entity.Error       = "Test Test ";

            using (rt.atl.business.manager.IPrzbufManager przbufManager = ObjectFactory.GetInstance <IPrzbufManager>())
            {
                var    all       = przbufManager.GetAll(1);
                Przbuf entityRef = null;
                if (all.Count > 0)
                {
                    entityRef = all[0];
                }

                if (entityRef == null && depth < 3)
                {
                    depth++;
                    entityRef = PrzbufTests.CreateNew(depth);
                    ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef);
                }

                entity.PrzBuff = entityRef;
            }

            return(entity);
        }
Exemplo n.º 2
0
        protected rt.atl.model.atl.Przbuf GetFirstPrzbuf()
        {
            IList <rt.atl.model.atl.Przbuf> entityList = manager.GetAll(1);

            if (entityList.Count == 0)
            {
                Assert.Fail("All tables must have at least one row for unit tests to succeed.");
            }
            return(entityList[0]);
        }