Exemplo n.º 1
0
 public void AddModerator(int forumId, int subForumId, int moderatorId)
 {
     if (_real != null)
     {
         _real.AddModerator(forumId, subForumId, moderatorId);
     }
     throw new NotImplementedException();
 }
Exemplo n.º 2
0
 public void AddModerator(int userId, int forumId, int subForumId, int moderatorId)
 {
     if (_real != null)
     {
         _real.AddModerator(1, forumId, subForumId, moderatorId);
     }
     throw new NullReferenceException("_real in null");
 }
Exemplo n.º 3
0
        public HttpResponseMessage Post_addModerator(int forumId, int subForumId, int userId, int moderatorId)
        {
            try
            {
                driver.AddModerator(userId, forumId, subForumId, moderatorId);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

                return(response);
            }
            catch (Exception e)
            {
                var data = new
                {
                    message = e.Message
                };
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotFound, data);
                return(response);
            }
        }