public void GroupsDiscussTopicsGetListTest() { var topics = AuthInstance.GroupsDiscussTopicsGetList(TestData.GroupId, 1, 10); Assert.IsNotNull(topics, "Topics should not be null."); Assert.AreEqual(TestData.GroupId, topics.GroupId, "GroupId should be the same."); Assert.AreNotEqual(0, topics.Count, "Should be more than one topics return."); Assert.AreEqual(10, topics.Count, "Count should be 10."); foreach (var topic in topics) { Assert.IsNotNull(topic.TopicId, "TopicId should not be null."); Assert.IsNotNull(topic.Subject, "Subject should not be null."); Assert.IsNotNull(topic.Message, "Message should not be null."); } var firstTopic = topics.First(); var secondTopic = AuthInstance.GroupsDiscussTopicsGetInfo(firstTopic.TopicId); Assert.AreEqual(firstTopic.TopicId, secondTopic.TopicId, "TopicId's should be the same."); Assert.AreEqual(firstTopic.Subject, secondTopic.Subject, "Subject's should be the same."); Assert.AreEqual(firstTopic.Message, secondTopic.Message, "Message's should be the same."); Assert.AreEqual(firstTopic.DateCreated, secondTopic.DateCreated, "DateCreated's should be the same."); Assert.AreEqual(firstTopic.DateLastPost, secondTopic.DateLastPost, "DateLastPost's should be the same."); }
public void GroupsDiscussTopicsGetInfoStickyTest() { const string topicId = "72157630982967152"; var topic = AuthInstance.GroupsDiscussTopicsGetInfo(topicId); Assert.IsTrue(topic.IsSticky, "This topic should be marked as sticky."); Assert.IsFalse(topic.IsLocked, "This topic should not be marked as locked."); // topic.CanReply should be true, but for some reason isn't, so we cannot test it. }
public void GroupsDiscussTopicsGetInfoLockedTest() { const string topicId = "72157630982969782"; var topic = AuthInstance.GroupsDiscussTopicsGetInfo(topicId); Assert.IsTrue(topic.IsLocked, "This topic should be marked as locked."); Assert.IsFalse(topic.IsSticky, "This topic should not be marked as sticky."); Assert.IsFalse(topic.CanReply, "CanReply should be false as the topic is locked."); }