Beispiel #1
0
        public virtual void setup()
        {
            _savedPosts = new List<Post>();

            var mongoRepository = new MongoRepository("blogspecs");
            mongoRepository.DeleteCollection<BlogSettings>();
            mongoRepository.DeleteCollection<Post>();

            _repository = mongoRepository;

            for (var i = 0; i < 10; i++)
            {
                var post = Post.CreatePost("Title" + i, "Body" + i, "BjartN", new List<Tag> {new Tag("tag"  + i), new Tag("tag" + (i+1))});
                _repository.Save(post);
                _savedPosts.Add(post);
            }
        }
Beispiel #2
0
        public virtual void setup()
        {
            var mongoRepository = new MongoRepository("blogspecs");
            mongoRepository.DeleteCollection<BlogSettings>();
            mongoRepository.DeleteCollection<Post>();

            _repository = mongoRepository;

            _blog = new BlogSettings
            {
                VirtualMediaPath = ""
            };
            _repository.Save(_blog);

            _fakePost = Post.CreatePost("Hello world", "", "BjartN", null);

            _repository.Save(_fakePost);

            _api = new  Infrastructure.MetaWeblogApi.MetaWeblog(_repository, new FakeUrlContext(),new FakeAuthenticationService());
        }