public void TestBuildMapper__IContextualNode()
        {
            NodeListMapperBuilder builder = new NodeListMapperBuilder("foo", typeof(List <DummyIContextualNode>));

            NodeListMapper mapper = Assert.IsType <NodeListMapper>(builder.BuildMapper());

            Assert.Equal("foo", mapper.name);
            Assert.Same(typeof(DummyIContextualNode), mapper.elementType);
            Assert.Same(typeof(List <DummyIContextualNode>), mapper.listType);
        }
Beispiel #2
0
        public void TestBuildMapper__ConfigNode()
        {
            NodeListMapperBuilder builder = new NodeListMapperBuilder("foo", typeof(List <ConfigNode>));

            NodeListMapper mapper = Assert.IsType <NodeListMapper>(builder.BuildMapper());

            Assert.Equal("foo", mapper.name);
            Assert.Same(typeof(List <ConfigNode>), mapper.listType);
            Assert.IsType <NodeObjectWrapperConfigNode>(mapper.nodeObjectWrapper);;
        }
        public void TestBuildMapper__CantBuild()
        {
            NodeListMapperBuilder builder = new NodeListMapperBuilder("foo", typeof(List <DummyClass>));

            Assert.Throws <InvalidOperationException>(() => builder.BuildMapper());
        }