public DbRepoStatusCode ActivateContentCategory(int categoryId, string isActive) { using (var context = new ApplicationDbContext()) { var contentCategory = context.ContentCategories.SingleOrDefault(c => c.Id == categoryId); if (contentCategory == null) { return(DbRepoStatusCode.NotFound); } _categoryManageService.ActivateContentCategory(contentCategory, isActive); context.SaveChanges(); return(DbRepoStatusCode.Success); } }
public void ActivateContentCategory(string request, bool isActive) { _contentCategoryManageService.ActivateContentCategory(_contentCategory, request); Assert.AreEqual(_contentCategory.IsActive, isActive); }