public void SaveBlogAddNewTest()
        {
            ContentService contentService = new ContentService();

            BlogDC serviceRequest=new BlogDC();
            serviceRequest.BlogCategoryId=1;
            serviceRequest.BlogTitle="Blog Test for Approval";
            serviceRequest.BlogDescription="Blog Test for Approval Description";
            serviceRequest.BlogContent="Test Content";
            contentService.SaveBlog(serviceRequest);
        }
        public void SaveBlogUpdateTest()
        {
            ContentService contentService = new ContentService();

            BlogDC serviceRequest = new BlogDC();

            serviceRequest.BlogId = 8;
            serviceRequest.BlogCategoryId = 1;
            serviceRequest.BlogTitle = "Blog Test for Approval-Updated";
            serviceRequest.BlogDescription = "Blog Test for Approval Description-Updated";
            serviceRequest.BlogContent = "Test Content-Updated";
            contentService.SaveBlog(serviceRequest);
        }
Example #3
0
 /// <summary>
 /// SaveBlog
 /// </summary>
 /// <param name="blogRequest"></param>
 /// <returns></returns>
 public ServiceResponse<int> SaveBlog(BlogDC blog)
 {
     ServiceResponse<int> blogResponse = new ServiceResponse<int>();
     try
     {
         SetContext();
         Blog blogModel = Mapper.Map<BlogDC, Blog>(blog);
         _contentManager.SaveBlog(blogModel);
         blogResponse.Result = blogModel.BlogId;
     }
     catch (Exception ex)
     {
         HandleError(ex, blogResponse);
     }
     return blogResponse;
 }