public void SaveCategoryTest() { User admin = URep.GetUserByUserName("Admin"); var category = new Category(); category.CategoryText = "hallo"; category.Questions = null; category.UserId = admin.Id; CatRep.Save(category); int id = category.Id; Assert.IsTrue(id > 0); Category dbCategory = DbContext.Categories.FirstOrDefault(x => x.CategoryText == category.CategoryText && x.Id == category.Id); Assert.IsTrue(dbCategory != null); CatRep.Delete(id); dbCategory = DbContext.Categories.FirstOrDefault(x => x.CategoryText == category.CategoryText && x.Id == category.Id); Assert.IsTrue(dbCategory == null); }