Exemplo n.º 1
0
        public void WeWillHAveADefaultFilterIfOneIsNotConfigured()
        {
            resolver.ComponentWriters.Add(new ComponentMap()
            {
                Type = "System.String", To = typeof(TestFilteredComponentWriter).AssemblyQualifiedName
            });
            IFilteredComponentWriter writer = (IFilteredComponentWriter)resolver.GetComponentWriter("Hello".GetType());

            Assert.That(writer, Is.Not.Null);
            Assert.That(writer, Is.InstanceOf <TestFilteredComponentWriter>());
            Assert.That(writer.filter, Is.Not.Null);
            Assert.That(writer.filter.filterType, Is.EqualTo(writer.defaultFilterType));
        }
Exemplo n.º 2
0
        public void WeWillHaveAFilterIfOneIsConfigured()
        {
            resolver.ComponentWriters.Add(new ComponentMap()
            {
                Type = "System.String", To = typeof(TestFilteredComponentWriter).AssemblyQualifiedName, FilterType = Filter.FilterType.Exclude, FilterItems = "filter"
            });
            IFilteredComponentWriter writer = (IFilteredComponentWriter)resolver.GetComponentWriter("Hello".GetType());

            Assert.That(writer, Is.Not.Null);
            Assert.That(writer, Is.InstanceOf <TestFilteredComponentWriter>());
            Assert.That(writer.filter, Is.Not.Null);
            Assert.That(writer.filter.filterType, Is.EqualTo(Filter.FilterType.Exclude));
            Assert.That(writer.filter.items, Contains.Item("filter"));
        }