Esempio n. 1
0
        public void AddSubCategoryTest()
        {
            Category parentCategory = dataService.FindMany(c => c.ParentCategoryId == null).OrderBy(c => Guid.NewGuid()).FirstOrDefault();

            Category newEntity = new Category();

            newEntity.Name           = "Kategori {0}".FormatWith(GetRandom());
            newEntity.IsActive       = true;
            newEntity.Description    = GetRandomString(10);
            newEntity.ParentCategory = parentCategory;

            dataService.Insert(newEntity);
            dataService.Save();

            Assert.AreNotEqual(Guid.Empty, newEntity.CategoryId);
        }