Exemplo n.º 1
0
        public void create_feed_source_type_for_enumerable_source()
        {
            var node = new FeedWriterNode <Address>(new Feed <Address>(), FeedSourceType.enumerable,
                                                    typeof(AddressEnumerable));

            node.FeedSourceType.ShouldEqual(typeof(EnumerableFeedSource <AddressEnumerable, Address>));
        }
Exemplo n.º 2
0
        public void create_feed_source_type_for_direct_enumerable()
        {
            var node = new FeedWriterNode <Address>(new Feed <Address>(), FeedSourceType.direct,
                                                    typeof(AddressValuesEnumerable));

            node.FeedSourceType.ShouldEqual(typeof(DirectFeedSource <AddressValuesEnumerable, Address>));
        }
Exemplo n.º 3
0
        public void build_object_def_has_correct_feed_writer_type()
        {
            var objectDef = new FeedWriterNode <Address>(new Feed <Address>(), FeedSourceType.enumerable,
                                                         typeof(AddressEnumerable)).ToObjectDef(DiagnosticLevel.None);


            objectDef.Type.ShouldEqual(typeof(FeedWriter <Address>));
        }
Exemplo n.º 4
0
        public void build_object_def_has_correct_feed_writer_type()
        {
            var objectDef = new FeedWriterNode <Address>(new Feed <Address>(), typeof(AddressEnumerable))
                            .As <IContainerModel>()
                            .ToObjectDef()
                            .FindDependencyDefinitionFor <IMediaWriter <IEnumerable <Address> > >();


            objectDef.Type.ShouldEqual(typeof(FeedWriter <Address>));
        }
Exemplo n.º 5
0
        public void has_a_dependency_for_the_ifeeddefinition()
        {
            var theFeed   = new Feed <Address>();
            var objectDef = new FeedWriterNode <Address>(theFeed, FeedSourceType.enumerable,
                                                         typeof(AddressEnumerable)).ToObjectDef(DiagnosticLevel.None);


            objectDef.DependencyFor <IFeedDefinition <Address> >()
            .ShouldBeOfType <ValueDependency>().Value.ShouldBeTheSameAs(theFeed);
        }
Exemplo n.º 6
0
        public void has_a_dependency_for_the_feed_source()
        {
            var theFeed = new Feed <Address>();
            var theNode = new FeedWriterNode <Address>(theFeed, FeedSourceType.enumerable,
                                                       typeof(AddressEnumerable));
            var objectDef = theNode.ToObjectDef(DiagnosticLevel.None);

            objectDef.DependencyFor <IFeedSource <Address> >()
            .ShouldBeOfType <ConfiguredDependency>()
            .Definition.Type.ShouldEqual(theNode.FeedSourceType);
        }
Exemplo n.º 7
0
        public void has_a_dependency_for_the_ifeeddefinition()
        {
            var theFeed   = new Feed <Address>();
            var objectDef = new FeedWriterNode <Address>(theFeed, typeof(AddressEnumerable))
                            .As <IContainerModel>()
                            .ToObjectDef()
                            .FindDependencyDefinitionFor <IMediaWriter <IEnumerable <Address> > >();


            objectDef.DependencyFor <IFeedDefinition <Address> >()
            .ShouldBeOfType <ValueDependency>().Value.ShouldBeTheSameAs(theFeed);
        }