Esempio n. 1
0
        static void Main(string[] args)
        {
            TopicPostDomainService topicPostService = new TopicPostDomainService(_topicPostRepository.Object,
                                                                                 _exceptionManagerAdapter.Object, _loggingServiceAdapter.Object);
            List <TopicPost> posts = topicPostService.GetTopicPostsByTopicId(3);

            System.Console.ReadLine();
        }
Esempio n. 2
0
        public void Constructor_TopicPostDomainService_Pos()
        {
            TopicPostDomainService topicPostService = new TopicPostDomainService(_topicPostRepository.Object, _exceptionManagerAdapter.Object, _loggingServiceAdapter.Object);

            Assert.AreEqual(_topicPostRepository.Object, topicPostService.TopicPostRepository);
            Assert.AreEqual(_exceptionManagerAdapter.Object, topicPostService.ExceptionManager);
            Assert.AreEqual(_loggingServiceAdapter.Object, topicPostService.LoggingService);
        }
Esempio n. 3
0
        /*[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));
        }