public void SetUp()
        {
            DropCollections();

            var category = new Category() {
                Name = "Test",
                Priority = 1
            };
            EntityStore.Save(category);

            var user = new User("Jef", "*****@*****.**");
            EntityStore.Save(user);

            var post1 = new Post()
            {
                PublishDate = DateTimeProvider.Now,
                Published = true
            };
            post1.AddLink(new Link(new Uri("http://jefclaes.be"), "Jef Claes", category.Id, user.Id));

            var post2 = new Post()
            {
                Published = false
            };
            post2.AddLink(new Link(new Uri("http://davybrion.com"), "Davy Brion", category.Id, user.Id));

            EntityStore.Save(post1);
            EntityStore.Save(post2);
        }
        private Category AddGeneralCategory()
        {
            var generalCategory = new Category() { Name = "General", Priority = 0 };
            MongoContext.GetCollection<Category>().Save(generalCategory);

            return generalCategory;
        }
Exemplo n.º 3
0
        private void SetUpCategories()
        {
            MongoContext.GetCollection<Category>().Drop();

            _dotNetCategory = new Category() { Name = ".NET", Priority = 100 };
            _nodeCategory = new Category() { Name = "Node.js", Priority = 10 };

            EntityStore.Save<Category>(_dotNetCategory);
            EntityStore.Save<Category>(_nodeCategory);
        }
Exemplo n.º 4
0
        public override void Execute()
        {
            var category = new Category() { Name = _name, Priority = _priority };

            EntityStore.Save(category);
        }