コード例 #1
0
        public void GetAllPublicPostsTest()
        {
            adminsPostRepository
            .Setup(post => post.GetAllPublic())
            .Returns(adminsPostsPublic);
            adminsPostService = new AdminsPostService(theaterScheduleUnitOfWork.Object, adminsPostRepository.Object);

            List <AdminsPost> posts =
                mapper.Map <List <AdminsPostDTO>, List <AdminsPost> >(adminsPostService.GetAllPublicPosts().ToList());

            CollectionAssert.AreEqual(adminsPostsPublic, posts, new AdminsPostComparer());
        }
コード例 #2
0
 public ActionResult <IEnumerable <AdminsPostDTO> > GetAllPublicPosts()
 {
     return(Ok(adminsPostService.GetAllPublicPosts()));
 }