static void Main(string[] args) { TopicPostDomainService topicPostService = new TopicPostDomainService(_topicPostRepository.Object, _exceptionManagerAdapter.Object, _loggingServiceAdapter.Object); List <TopicPost> posts = topicPostService.GetTopicPostsByTopicId(3); System.Console.ReadLine(); }
/*[Test] * [Category("Positive Test")] * [Category("GetTopicPostsByTopicId")]*/ public void Verify_If_TopicPosts_Exists_For_Topic_Pos() { List <TopicPost> topicPostList = new List <TopicPost>(); topicPostList.Add(new TopicPost() { Id = 1, IP = "192.168.0.1", Title = "My Post", Status = 1, Body = "Body of the post", DateCreated = DateTime.ParseExact("2013-04-09", "yyyy-mm-dd", DateTimeFormatInfo.InvariantInfo), Votes = 3, PostedByUserId = 2, ParentTopicPostId = null, TopicId = 3 }); TopicPostDomainService topicPostService = new TopicPostDomainService(_topicPostRepository.Object, _exceptionManagerAdapter.Object, _loggingServiceAdapter.Object); //_topicPostRepository.Setup(tp => tp.); Assert.AreEqual(topicPostList, topicPostService.GetTopicPostsByTopicId(3)); }