Ejemplo n.º 1
0
        public HomeControllerTest()
        {
            var dataGenerator = new ContentFactory(RandomDataGenerator.Instance);
            var cacheService  = new Mock <ICacheService>();

            cacheService.Setup(m => m.HomePosts).Returns(dataGenerator.GetPosts(3).ToList());
            var autoMapperConfig = new AutoMapperConfig();

            autoMapperConfig.Execute();
            this.Controller = new HomeController(cacheService.Object);
        }
Ejemplo n.º 2
0
        public PostsControllerTest()
        {
            var dataGenerator = new ContentFactory(RandomDataGenerator.Instance);
            var postService   = new Mock <IPostService>();

            new Mock <IFileStorage>();
            postService.Setup(m => m.GetTheLatestPosts()).Returns(dataGenerator.GetPosts(20));
            var autoMapperConfig = new AutoMapperConfig();

            autoMapperConfig.Execute();
            this.controller = new PostsController(postService.Object);
        }