Example #1
0
        public void Create(Feed newFeed)
        {
            if (newFeed == null) {
                throw new ArgumentNullException("newFeed", "Please provide a valid Feed object.");
            }

            if (newFeed.Id == Guid.Empty) {
                newFeed.Id = Guid.NewGuid();
            }

            newFeed.Created = DateTime.Now;

            var db = GetDatabase();
            db.Insert(newFeed);
        }
Example #2
0
        public void Can_Create_New_Feed()
        {
            var id = Guid.NewGuid();
            var feedName = "Test_" + id;

            var newFeed = new Feed {
                Name = feedName,
                IsPublic = true,
                Description = "Test Feed"
            };

            var repository = new FeedRepository();
            repository.Create(newFeed);

            var foundFeed = repository.Fetch(feedName);
            Assert.AreEqual(foundFeed.Name, newFeed.Name);
        }
Example #3
0
 public void Update(Feed updatedFeed)
 {
     var db = GetDatabase();
     db.Update(updatedFeed);
 }