Ejemplo n.º 1
0
        public void modify_with_null_ignores_it()
        {
            var subject = new ItemSubject {
                Title = null
            };
            var target = new SimpleValues <ItemSubject>(subject);
            var item   = new SyndicationItem();

            var map = new FeedItem <ItemSubject>().As <IFeedItem <ItemSubject> >();

            map.ModifyItem(x => x.Title, (syn, val) => syn.Content = val.ToContent());
            map.ConfigureItem(item, target);

            item.Content.ShouldBeNull();
        }
Ejemplo n.º 2
0
        public void modify_sets_property()
        {
            var subject = new ItemSubject {
                Title = "Monty Python"
            };
            var target = new SimpleValues <ItemSubject>(subject);
            var item   = new SyndicationItem();

            var map = new FeedItem <ItemSubject>().As <IFeedItem <ItemSubject> >();

            map.ModifyItem(x => x.Title, (syn, val) => syn.Content = val.ToContent());
            map.ConfigureItem(item, target);

            item.Content.As <TextSyndicationContent>().Text
            .ShouldEqual(subject.Title);
        }
Ejemplo n.º 3
0
        public void modify_with_null_ignores_it()
        {
            var subject = new ItemSubject { Title = null };
            var target = new SimpleValues<ItemSubject>(subject);
            var item = new SyndicationItem();

            var map = new FeedItem<ItemSubject>().As<IFeedItem<ItemSubject>>();
            map.ModifyItem(x => x.Title, (syn, val) => syn.Content = val.ToContent());
            map.ConfigureItem(item, target);

            item.Content.ShouldBeNull();            
        }
Ejemplo n.º 4
0
        public void modify_sets_property()
        {
            var subject = new ItemSubject { Title = "Monty Python" };
            var target = new SimpleValues<ItemSubject>(subject);
            var item = new SyndicationItem();

            var map = new FeedItem<ItemSubject>().As<IFeedItem<ItemSubject>>();
            map.ModifyItem(x => x.Title, (syn, val) => syn.Content = val.ToContent());
            map.ConfigureItem(item, target);

            item.Content.As<TextSyndicationContent>().Text
                .ShouldEqual(subject.Title);
        }