Exemplo n.º 1
0
        public void FsRootCategoryTest()
        {
            var result = mockSource.GetItems(new FSCategoryRequest(@"C:\").Process());

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Items);
            Assert.IsTrue(result.Items.Any());
        }
        public void GetCategoriesTest()
        {
            var result = mockSource.GetItems(itemsDataSource);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Items);
            Assert.IsTrue(result.Items.Any());
            Assert.AreEqual(new DateTime(2012, 1, 1), result.Items.First().Value.LastUpdatedTime.DateTime);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public SyndicationItem GetDetail(string id)
        {
            if (String.IsNullOrEmpty(id))
            {
                throw new ArgumentNullException("id");
            }

            var book = dbContext.Books.Single(b => b.Id == new Guid(id));

            book.OpdsDataType = OpdsDataType.Detial;
            var result = itemConverter.GetItems(new OpdsData(new[] { book })).Items.Single();

            book.OpdsDataType = OpdsDataType.Entity;

            return(result.Value);
        }