public void DeleteComment(string id)
 {
     try
     {
         CommentControl.GetInstance().DeleteComment(id, GetServiceUserEmail());
     }catch (InvalidOperationException)
     {
         throw new WebFaultException <string>("Can not delete other people's comments", HttpStatusCode.Unauthorized);
     }
 }
Esempio n. 2
0
        public void TestGetAdComments()
        {
            var author = "*****@*****.**";
            Ad  ad     = control.PostAd(author, "Unit Test", "Should not matter what I type here.", "Aalborg", AdType.Buying);

            CommentControl.GetInstance().PostComment(ad.Id, "Test comment", "*****@*****.**");
            var results = control.GetComments(0, 64, ad.Id);

            Assert.IsTrue(results.Count == 0);
            control.DeleteAd(ad.Id, author);
        }
 public void PostComment(string adId, string content)
 {
     CommentControl.GetInstance().PostComment(adId, content,
                                              GetServiceUserEmail());
 }