コード例 #1
0
        public void TypeRendererMap_AddRenderer_ActuallyAddsRenderer()
        {
            var map = new TypeRendererMap(new KeyValuePair <Type, IPropertyRenderer>(typeof(Exception), new ExceptionAsXmlRenderer()));

            map.AddRenderer(typeof(DateTime), new ToStringRenderer());
            Assert.IsNotNull(map.GetRenderer <DateTime>());
        }
コード例 #2
0
        public void TypeRendererMap_RemoveRenderer_ActuallyRemovesRenderer()
        {
            var map = new TypeRendererMap(new KeyValuePair <Type, IPropertyRenderer>(typeof(Exception), new ExceptionAsXmlRenderer()));

            map.RemoveRenderer(typeof(Exception));
            Assert.IsNull(map.GetRenderer <Exception>());
        }
コード例 #3
0
        public void TypeRendererMap_GetRendererReturnsRenderer()
        {
            var map = new TypeRendererMap(new KeyValuePair <Type, IPropertyRenderer>(typeof(Exception), new ExceptionAsXmlRenderer()));

            Assert.IsNotNull(map.GetRenderer(typeof(Exception)));
        }