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>)); }
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>)); }
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>)); }
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>)); }
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); }
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); }
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); }