Exemplo n.º 1
0
        public override Constant CreateSampleEntity()
        {
            ConstantCategoryUnitTestHelper categoryHelper = new ConstantCategoryUnitTestHelper();
            Constant constant = BuildSampleEntity <Constant>();

            constant.ConstantCategory   = categoryHelper.CreateSampleEntity();
            constant.ConstantCategoryID = constant.ConstantCategory.ID;
            constant.Culture            = GetRandomCulture();
            return(constant);
        }
Exemplo n.º 2
0
        protected override void SeedMockEntityList(IList <Constant> mockEntityList)
        {
            ConstantCategoryUnitTestHelper categoryHelper = new ConstantCategoryUnitTestHelper();
            IList <ConstantCategory>       categoryList   = categoryHelper.CreateSampleEntityList(2, 10);

            for (int i = 0; i < categoryList.Count; i++)
            {
                ConstantCategory cat = categoryList[i];
                cat.ID = i + 1;
            }

            IList <Constant> createdList = CreateSampleEntityList(10, 100);

            for (int i = 0; i < createdList.Count; i++)
            {
                ConstantCategory category = categoryList[_rand.Next() % categoryList.Count];
                createdList[i].ID = i + 1;
                createdList[i].ConstantCategory   = category;
                createdList[i].ConstantCategoryID = category.ID;
                mockEntityList.Add(createdList[i]);
            }
        }