Example #1
0
        public void AddCategoryTest()
        {
            Category newEntity = new Category();
            newEntity.Name = string.Format("Kategori {0}", GetRandom());
            newEntity.IsActive = true;
            newEntity.Description = GetRandomString(10);

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

            Assert.AreNotEqual(Guid.Empty, newEntity.CategoryId);
        }
Example #2
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);
        }