Ejemplo n.º 1
0
 public void TestGetTopicByName()
 {
     TransitTopic t_topic = new TransitTopic();
     t_topic.Name = Guid.NewGuid().ToString();
     t_topic.Type = Guid.NewGuid().ToString();
     Assert.IsNull(Blog.GetTopicByName(Ticket, t_topic.Name));
     t_topic.Id = Blog.CreateOrUpdateTopic(Ticket, t_topic);
     TransitTopic t_topic_2 = Blog.GetTopicByName(Ticket, t_topic.Name);
     Assert.IsNotNull(t_topic_2);
     Assert.AreEqual(t_topic.Name, t_topic_2.Name);
     Blog.DeleteTopic(Ticket, t_topic.Id);
 }
Ejemplo n.º 2
0
 public BlogTopicTest()
 {
     mTopic = new TransitTopic();
     mTopic.Name = Guid.NewGuid().ToString();
     mTopic.Type = Guid.NewGuid().ToString();
 }
Ejemplo n.º 3
0
        public void CreatePostWithTwoTopicsTest()
        {
            // topic
            TransitTopic t_topic1 = new TransitTopic();
            t_topic1.Name = Guid.NewGuid().ToString();
            t_topic1.Id = Blog.CreateOrUpdateTopic(Ticket, t_topic1);
            TransitTopic t_topic2 = new TransitTopic();
            t_topic2.Name = Guid.NewGuid().ToString();
            t_topic2.Id = Blog.CreateOrUpdateTopic(Ticket, t_topic2);

            // post
            TransitPost t_post = new TransitPost();
            t_post.Body = Guid.NewGuid().ToString();
            t_post.Title = Guid.NewGuid().ToString();
            List<TransitTopic> topics = new List<TransitTopic>();
            topics.Add(t_topic1);
            topics.Add(t_topic2);
            t_post.Topics = topics.ToArray();
            t_post.Publish = true;
            t_post.Id = Blog.CreateOrUpdatePost(Ticket, t_post);
            Assert.Greater(t_post.Id, 0);

            TransitPost t_post_retrieved = Blog.GetPostById(Ticket, t_post.Id);
            Assert.AreEqual(t_post_retrieved.Topics.Length, t_post.Topics.Length);

            Blog.DeletePost(Ticket, t_post.Id);
            Blog.DeleteTopic(Ticket, t_topic1.Id);
            Blog.DeleteTopic(Ticket, t_topic2.Id);
        }
Ejemplo n.º 4
0
 /// <remarks/>
 public void CreateOrUpdateTopicAsync(string ticket, TransitTopic t_topic, object userState) {
     if ((this.CreateOrUpdateTopicOperationCompleted == null)) {
         this.CreateOrUpdateTopicOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrUpdateTopicOperationCompleted);
     }
     this.InvokeAsync("CreateOrUpdateTopic", new object[] {
                 ticket,
                 t_topic}, this.CreateOrUpdateTopicOperationCompleted, userState);
 }
Ejemplo n.º 5
0
 /// <remarks/>
 public void CreateOrUpdateTopicAsync(string ticket, TransitTopic t_topic) {
     this.CreateOrUpdateTopicAsync(ticket, t_topic, null);
 }
Ejemplo n.º 6
0
 public int CreateOrUpdateTopic(string ticket, TransitTopic t_topic) {
     object[] results = this.Invoke("CreateOrUpdateTopic", new object[] {
                 ticket,
                 t_topic});
     return ((int)(results[0]));
 }