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); }
public BlogTopicTest() { mTopic = new TransitTopic(); mTopic.Name = Guid.NewGuid().ToString(); mTopic.Type = Guid.NewGuid().ToString(); }
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); }
/// <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); }
/// <remarks/> public void CreateOrUpdateTopicAsync(string ticket, TransitTopic t_topic) { this.CreateOrUpdateTopicAsync(ticket, t_topic, null); }
public int CreateOrUpdateTopic(string ticket, TransitTopic t_topic) { object[] results = this.Invoke("CreateOrUpdateTopic", new object[] { ticket, t_topic}); return ((int)(results[0])); }